You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(vitest,tinybench): emit benchmark markers inside the sample window
Emit benchmark start/end markers for the tinybench plugin and the vitest
walltime runner, wrapping the measured function in a root frame.
The runner consumes the instrument-hooks FIFO stream in order and expects
SampleStart > BenchmarkStart > BenchmarkEnd > SampleEnd nesting per
benchmark, so the markers must land inside the sample window:
- vitest: emit the marker pair before stopBenchmark(), and move
stopBenchmark() plus the markers into a finally block so a throwing
benchmark cannot leave the profiler started-but-never-stopped
- tinybench: emit markers per task between start/stop instead of a single
run-level pair; wrap the body in try/finally to keep start/stop balanced
when a benchmark throws
- benchmark.js: bind wrapWithRootFrame/wrapWithRootFrameSync to the real
implementations in the integ test's core mock
Add a regression test asserting both markers land between startBenchmark
and stopBenchmark in walltime mode.
0 commit comments