mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
80efd75b8e5f83a5473afa0dc45f49428e2fce6f
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.
Description
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%