docs/benchmarks.md
V8 performance is typically tracked using industry-standard benchmark suites that reflect real-world usage.
For modern V8 performance tracking, we recommend using:
Before running benchmarks, ensure your CPU is configured for consistent results by setting the frequency scaling governor to performance.
sudo tools/cpu.sh fast
V8 maintains a suite of microbenchmarks in test/js-perf-test for tracking the performance of specific language features. These are run using tools/run_perf.py:
tools/run_perf.py --arch x64 --binary-override-path out/x64.release/d8 test/js-perf-test/JSTests.json
For more details, see the testing guide.
d8 Flags for Benchmarking--no-opt: Disables all optimizing compilers (TurboFan, Maglev).--no-sparkplug: Disables the Sparkplug baseline compiler.--no-maglev: Disables the Maglev mid-tier compiler.--no-turbofan: Disables the TurboFan top-tier optimizing compiler.--trace-opt: Trace optimized compilation events.--trace-deopt: Trace deoptimization events.--trace-ic: Trace inline cache behavior.--print-opt-code: Print the generated machine code for optimized functions.--trace-turbo: Trace the TurboFan compilation pipeline (generates turbo-*.json and turbo-*.dot files).--trace-turbo-filter=<filter>: Only trace specific functions that match the filter.--trace-maglev: Same as --trace-turbo but for the Maglev compiler.--prof: Log statistical profiling information for CPU profiling. Use tools/linux-tick-processor (on Linux) to process the resulting v8.log.--log-timer-events: Log timer events (including console.time and internal V8 events).--trace-gc: Print a trace line for each garbage collection.--max-semi-space-size=<MB>: Adjusts the young generation (nursery) heap size.--max-old-space-size=<MB>: Adjusts the old generation heap size.