Files
v8/docs/benchmarks.md
Camillo Bruni 0c15a50172 [docs] Update outdated docs
- Use more code search (http://crsrc.org) links instead of pointing
  to github or gitiles files directly
- Update benchmarks.md and remove reference to csuite.py
- Update torque and C++ example code

Bug: 500280354
Change-Id: Ib7027b284179aa1740a491afc4b4b5a6654e0570
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7715583
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106411}
2026-04-13 01:37:04 -07:00

2.4 KiB

title, description
title description
Running benchmarks locally 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 fast

Internal 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.json

For 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 (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.

Profiling

  • --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).

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.