261004.7 · deps: update V8 to 15.2.124.38
title: ‘Running benchmarks locally’ description: ‘This document explains how to run benchmark suites in d8.’
V8 performance is typically tracked using industry-standard benchmark suites that reflect real-world usage.
For modern V8 performance tracking, we recommend using:
- Speedometer: The current industry standard for measuring web application responsiveness.
- JetStream: Focuses on advanced web applications and includes JavaScript and WebAssembly.
CPU Configuration
Before running benchmarks, ensure your CPU is configured for consistent results by setting the frequency scaling governor to performance.
sudo tools/cpu.sh fastInternal Microbenchmarks
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.jsonFor more details, see the testing guide.
Useful d8 Flags for Benchmarking
Compiler Control
--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 (generatesturbo-*.jsonandturbo-*.dotfiles).--trace-turbo-filter=<filter>: Only trace specific functions that match the filter.--trace-maglev: Same as--trace-turbobut for the Maglev compiler.
Profiling
--prof: Log statistical profiling information for CPU profiling. Usetools/linux-tick-processor(on Linux) to process the resultingv8.log.--log-timer-events: Log timer events (includingconsole.timeand internal V8 events).
Memory & Garbage Collection
--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.