Skip to content

Commit ad80855

Browse files
committed
docs: update benchmark results and improve performance section in README
1 parent 813da18 commit ad80855

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,31 @@ fn main() {
5050

5151
## Performance
5252

53-
test file `run-tests.php` from [php-src](https://github.com/php/php-src/blob/801e587faa0efd2fba633413681c68c83d6f2188/run-tests.php) with 140KB size, here are the benchmark results:
53+
Test file `run-tests.php` from [php-src](https://github.com/php/php-src/blob/801e587faa0efd2fba633413681c68c83d6f2188/run-tests.php) with 140KB size, here are the benchmark results:
5454

5555
```bash
56-
➜ php-parser git:(master) ✗ ./target/release/bench_file run-tests.php
56+
➜ php-parser git:(master) ✗ cargo run --release --bin bench_file -- run-tests.php
57+
Finished `release` profile [optimized] target(s) in 0.05s
58+
Running `target/release/bench_file run-tests.php`
5759
Benchmarking: run-tests.php
5860
File size: 139.63 KB
5961
Warming up...
6062
Running 200 iterations...
6163
Profile written to profile.pb
6264
Flamegraph written to flamegraph.svg
63-
Total time: 132.538ms
64-
Average time: 662.69µs
65-
Throughput: 205.76 MB/s
65+
Total time: 134.267333ms
66+
Average time: 671.336µs
67+
Throughput: 203.11 MB/s
6668
```
6769

68-
Machine specs: Apple M1 Pro, 32GB RAM
70+
Table comparing with [nikic/PHP-Parser](https://github.com/nikic/PHP-Parser) v5.6.2
71+
72+
| Parser | Language | Time (ms) |
73+
|-------------------|----------------|------------------|
74+
| nikic/PHP-Parser | PHP | 33 |
75+
| php-parser | Rust | 0.67 |
76+
77+
> Machine specs: Apple M1 Pro, 32GB RAM
6978
7079
## Development
7180

0 commit comments

Comments
 (0)