Skip to content

Commit cb9a395

Browse files
committed
Mark WP_Parser_Node as final
Nothing extends WP_Parser_Node. Marking it final lets PHP's opcache and tracing JIT specialize property access and method dispatch since the class layout is now fixed. Small but consistent improvement measured across multiple runs under tracing JIT (~+2% avg, ~+2% best). End-to-end parser benchmark: tracing JIT: ~57K -> ~57-58K QPS avg, 60-61K QPS best no JIT: ~33K -> ~34K QPS avg, 35K QPS best
1 parent ce75275 commit cb9a395

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/mysql-on-sqlite/src/parser/class-wp-parser-node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* In this way, a parser node constitutes a recursive structure that represents
1010
* a parse (sub)tree at each level of the full grammar tree.
1111
*/
12-
class WP_Parser_Node {
12+
final class WP_Parser_Node {
1313
/**
1414
* @TODO: Review and document these properties and their visibility.
1515
*/

0 commit comments

Comments
 (0)