Skip to content

Commit a90889c

Browse files
committed
Refresh native-extension benchmark numbers
Re-measure the documented lexer/parser benchmarks on this branch (PHP 8.5.5, current extension build) and replace the stale trunk/PHP-8.4.5 figures. The parser native row drops from 108,354 QPS (15.45x) to 58,111 QPS (2.00x): trunk's native parser returned a lazy wrapper, so the parse-only benchmark never built the tree. This branch materializes the full WP_Parser_Node tree eagerly, so the number now reflects producing a complete AST. The lexer pure-PHP row rises (71,553 -> 178,409 QPS) thanks to the lexer optimizations on this branch, narrowing the native lexer speedup to 2.00x. Note the default-CLI (no JIT) methodology and that under opcache + tracing JIT the native edge narrows further (lexer ~1.08x, parser ~1.13x).
1 parent 8af0ce5 commit a90889c

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

‎packages/php-ext-wp-mysql-parser/README.md‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,22 @@ The GitHub Pages demo reads published benchmark data from:
8686

8787
<https://wordpress.github.io/sqlite-database-integration/native-extension/benchmark.json>
8888

89-
Latest local measurement (Apple Silicon macOS, PHP 8.4.5 CLI, 2026-05-26):
89+
Latest local measurement (Apple Silicon macOS, PHP 8.5.5 CLI, default config without JIT, 2026-06-04):
9090

9191
| Benchmark | Implementation | Queries | QPS | Speedup |
9292
| --- | --- | ---: | ---: | ---: |
93-
| MySQL lexer | Pure PHP | 69,577 | 71,553 | — |
94-
| MySQL lexer | Native extension | 69,577 | 343,124 | 4.80x |
95-
| MySQL parser | Pure PHP | 69,577 | 7,015 | — |
96-
| MySQL parser | Native extension | 69,577 | 108,354 | 15.45x |
93+
| MySQL lexer | Pure PHP | 69,577 | 178,409 | — |
94+
| MySQL lexer | Native extension | 69,577 | 355,084 | 2.00x |
95+
| MySQL parser | Pure PHP | 69,577 | 29,048 | — |
96+
| MySQL parser | Native extension | 69,577 | 58,111 | 2.00x |
97+
98+
The parser rows are parse-only. On this branch the native parser materializes the full
99+
`WP_Parser_Node` tree eagerly, so the number reflects building a complete AST rather than a
100+
deferred handle (the earlier 15x figure measured a lazy parse that never built the tree).
101+
102+
These are default-CLI numbers, matching the published `benchmark.json` environment. The native
103+
code is JIT-independent, while the pure-PHP path speeds up substantially under opcache + tracing
104+
JIT, so the native edge there narrows to roughly 1.1x (lexer ~1.08x, parser ~1.13x).
97105

98106
That file should be updated whenever a new extension build or benchmark environment is published.
99107

0 commit comments

Comments
 (0)