Add necessary flags to dump optimized inlining info and fix walltime marker placement#83
Conversation
Add --perf-prof, --log-code, --no-log-source-code, --no-logfile-per-isolate and --logfile to getV8Flags in walltime mode. --perf-prof writes the jitdump samply uses to symbolicate JIT'd JS; --log-code writes the code log whose inlining map lets the symbolicating recover TurboFan/Maglev inlined frames the jitdump alone collapses. Source-code logging is left off to keep the log small. Refs COD-2821, COD-2822
0b43ff4 to
e07237e
Compare
Merging this PR will degrade performance by 74.17%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | switch 2 |
1 B | 384 B | -99.74% |
| ❌ | Memory | switch 2 |
1 B | 384 B | -99.74% |
| ❌ | Memory | test_iterative_fibo_100 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test_iterative_fibo_10 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test_recursive_cached_fibo_20 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test_recursive_cached_fibo_20 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test_recursive_cached_fibo_30 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test_iterative_fibo_100 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test sync baz 100 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test_recursive_cached_fibo_30 |
1 B | 264 B | -99.62% |
| ❌ | Memory | switch 2 |
1 B | 264 B | -99.62% |
| ❌ | Memory | test sync baz 100 |
1 B | 264 B | -99.62% |
| ❌ | Memory | fibo 30 |
19 B | 531 B | -96.42% |
| ❌ | Memory | test_recursive_fibo_20 |
19 B | 264 B | -92.8% |
| ❌ | Memory | test_recursive_fibo_20 |
19 B | 264 B | -92.8% |
| ❌ | Simulation | test_recursive_fibo_10 |
145.2 µs | 282.2 µs | -48.56% |
| ❌ | Simulation | switch 2 |
11.2 µs | 21.5 µs | -47.96% |
| ❌ | Memory | test sync baz 10 |
385 B | 648 B | -40.59% |
| ❌ | Memory | test sync baz 10 |
385 B | 648 B | -40.59% |
| ❌ | Simulation | one |
402.7 µs | 590.3 µs | -31.78% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cod-2821-v8-maglevturbofan-inlining-loses-nested-inline-information (16bf967) with main (bcd7e64)1
Footnotes
Greptile SummaryThis PR wires up
Confidence Score: 5/5The core logic changes are safe to merge; the marker-ordering issue in the tinybench walltime teardown was already identified in prior review rounds. The V8 flag additions and linuxPerf gating are straightforward and low-risk. The tinybench-plugin refactor correctly replaces the broken private-field cast pattern with a WeakMap capture, and the vitest-plugin's closeInstrumentWindow already emits markers in the right order. The only unresolved finding in this pass is a missing Linear reference on a TODO comment in the workflow file. packages/tinybench-plugin/src/walltime.ts — the marker-ordering issue (stopBenchmark before addMarker in the teardown hook) flagged in prior threads remains unaddressed in this diff. Important Files Changed
|
…only The runner wrapped the entire tinybench Task.run() in the instrumentation window, folding the run-mode setup/teardown hooks and processRunResult (which sorts the latency samples twice and computes the full statistics) into the recorded sample. That framework overhead showed up in the walltime flamegraph. Drive the window from each bench's run-mode setup/teardown hooks instead, so it brackets only the measured loop. Warmup already runs as a separate Vitest call and is now excluded, and the post-loop statistics computation falls outside the window. User-provided hooks are preserved. The tinybench module namespace is frozen, so the instrumented Bench is handed back through a fresh module-shaped object that Vitest destructures from rather than reassigning the export. Closes COD-2925 Co-Authored-By: Claude <noreply@anthropic.com>
tinybench v6 moved the benchmark function, its options, and the resolved bench options behind ES private fields (and flattened the options onto the bench instance), which broke the plugin's reliance on reaching those internals through casts: analysis mode crashed with "fn is not a function" and walltime mode crashed reading `bench.opts.setup`. Capture the function and options ourselves when `bench.add` runs, normalize option access across the v4/v5 `bench.opts` layout and the v6 flattened one, bake the walltime root frame into the registered function instead of mutating the (now private) task function, and opt back into sample retention that v6 disabled by default. Add dedicated example fixtures pinning tinybench v5 and v6 so CI exercises every supported major, excluding them from the Node 18 leg since tinybench v5+ requires Node >=20. Closes COD-2929 Co-Authored-By: Claude <noreply@anthropic.com> Generated with AI Agent (Claude Code)
5b668b0 to
89b8a9a
Compare
ad2afb2 to
c52eabe
Compare
ad2afb2 to
f7030ac
Compare
f7030ac to
16bf967
Compare
No description provided.