mirror of
https://github.com/facebook/react.git
synced 2026-02-27 03:07:57 +00:00
Updates the parser-benchmark script to use a benchmarking framework, and also brings in yargs to make it easier to handle parsing arguments. Non-CI usage: ``` $ cd bench/parser-benchmark $ yarn bench --help Options: --help Show help [boolean] --ci [boolean] [default: false] --sampleSize [number] [default: 1] $ yarn bench --sampleSize=3 [ISOBENCH ENDED] Parser Benchmark (3 times) OXC - 32 op/s. 3 samples in 9518 ms. 5.288x (BEST) SWC - 20 op/s. 3 samples in 9487 ms. 3.256x HermesParser - 6 op/s. 3 samples in 9124 ms. 1.000x (WORST) Forget (Rust) - 15 op/s. 3 samples in 9749 ms. 2.499x ``` In CI this outputs JSON instead of logging to stdout. The results are stored in github's action cache and used as a point of comparison when new commits are pushed to main. The comparison should be shown on workflow [summary pages](https://github.com/facebook/react-forget/actions/runs/5956421081), but nothing will be populated until we merge this PR. We intentionally only run this workflow on main as any run would override the last cached result, so a PR with multiple pushes would then start having comparisons with itself.