internal(bench-react): Add V8 opt/deopt investigation#3874
Conversation
Add BENCH_V8_TRACE and BENCH_V8_DEOPT env vars to the React benchmark runner. Trace mode uses launchServer to pipe Chromium's --trace-opt --trace-deopt output to v8-trace.log. Deopt mode passes --prof to write per-process V8 profiling logs to v8-logs/. Convenience scripts bench:trace and bench:deopt default to data-client small scenarios. Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
There was a problem hiding this comment.
Benchmark React
Details
| Benchmark suite | Current: faadd28 | Previous: 467a5f6 | Ratio |
|---|---|---|---|
data-client: getlist-100 |
165.3 ops/s (± 3.8%) |
196.08 ops/s (± 2.7%) |
1.19 |
data-client: getlist-500 |
44.84 ops/s (± 6.4%) |
46.73 ops/s (± 5.8%) |
1.04 |
data-client: update-entity |
400 ops/s (± 4.8%) |
425.72 ops/s (± 6.8%) |
1.06 |
data-client: update-user |
384.62 ops/s (± 6.6%) |
434.78 ops/s (± 4.9%) |
1.13 |
data-client: getlist-500-sorted |
47.85 ops/s (± 6.3%) |
49.14 ops/s (± 7.5%) |
1.03 |
data-client: update-entity-sorted |
333.33 ops/s (± 5.2%) |
370.88 ops/s (± 5.8%) |
1.11 |
data-client: update-entity-multi-view |
370.37 ops/s (± 4.7%) |
363.76 ops/s (± 10.1%) |
0.98 |
data-client: list-detail-switch-10 |
11.85 ops/s (± 6.6%) |
12.8 ops/s (± 6.5%) |
1.08 |
data-client: update-user-10000 |
90.09 ops/s (± 2.2%) |
91.74 ops/s (± 0.0%) |
1.02 |
data-client: invalidate-and-resolve |
49.5 ops/s (± 2.7%) |
45.56 ops/s (± 6.4%) |
0.92 |
data-client: unshift-item |
285.71 ops/s (± 4.5%) |
250 ops/s (± 5.6%) |
0.88 |
data-client: delete-item |
400 ops/s (± 4.3%) |
384.62 ops/s (± 4.6%) |
0.96 |
data-client: move-item |
222.22 ops/s (± 4.2%) |
243.9 ops/s (± 3.4%) |
1.10 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3874 +/- ##
=======================================
Coverage 98.10% 98.10%
=======================================
Files 153 153
Lines 2899 2899
Branches 564 564
=======================================
Hits 2844 2844
Misses 11 11
Partials 44 44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d7edab1. Configure here.

Motivation
The Node benchmark (
examples/benchmark) hasstart:traceandstart:deoptscripts for V8 optimization/deoptimization investigation, but the React benchmark (examples/benchmark-react) had no equivalent. When investigating performance regressions that involve React rendering, you had to use the Node benchmark for deopt analysis and then separately validate with the React benchmark — with no way to see V8 JIT decisions in the browser context.Solution
Add two new env-var-driven modes to the React benchmark runner:
BENCH_V8_TRACE=true— launches Chromium with--js-flags="--trace-opt --trace-deopt"vialaunchServer(needed becauseBrowserfromlaunch()has noprocess()), pipes browser stderr/stdout tov8-trace.logBENCH_V8_DEOPT=true— launches Chromium with--js-flags="--prof", writes per-process V8 profiling logs tov8-logs/, and prints thenode --prof-processcommand for the renderer log (largest file)Convenience scripts
bench:traceandbench:deoptdefault to--lib data-client --size smallfor focused investigation.Files changed:
examples/benchmark-react/bench/runner.ts—launchBenchChromium(),buildV8LaunchArgs(),reportV8Logs()examples/benchmark-react/package.json—bench:trace,bench:deoptscripts.gitignore—v8-logs/examples/benchmark-react/README.md— Profiling sectionexamples/benchmark-react/AGENTS.md— env var table.cursor/rules/benchmarking.mdc— React benchmark profiling subsectionOpen questions
N/A
Made with Cursor
Note
Low Risk
Low risk: changes are isolated to the React benchmark runner and docs, adding optional Chromium launch flags and log artifact handling with no impact on product/runtime code.
Overview
Adds opt-in V8 optimization/deoptimization investigation to
examples/benchmark-reactviaBENCH_V8_TRACEandBENCH_V8_DEOPT, passing Chromium--js-flagsfor--trace-opt/--trace-deoptand--prof.Updates the Playwright runner to optionally use
chromium.launchServer()so root browser stdout/stderr can be piped tov8-trace.log, and to create/reportv8-logs/profiling artifacts after runs.Introduces convenience scripts
bench:trace/bench:deopt, documents the new modes, and ignoresv8-logs/in.gitignore.Reviewed by Cursor Bugbot for commit faadd28. Bugbot is set up for automated code reviews on this repo. Configure here.