Skip to content

fix(benchmark.js): collect garbage before synchronous measurements - #112

Closed
not-matthias wants to merge 1 commit into
mainfrom
cod-4028-use-predictable-gc-schedule-in-codspeed-node-for-memory
Closed

not-matthias wants to merge 1 commit into
mainfrom
cod-4028-use-predictable-gc-schedule-in-codspeed-node-for-memory

fix(benchmark.js): collect garbage before synchronous measurements

6925940
Select commit
Loading
Failed to load commit list.
CodSpeed / CodSpeed Performance Analysis failed Oct 29, 2026 in 0s

Performance Regression: -3.68%

3 warnings, 1 note

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 14 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

ℹ️ 16 benchmarks have no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

⚡ 9 improved benchmarks
❌ 8 regressed benchmarks
✅ 247 untouched benchmarks
⏩ 56 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation test_recursive_fibo_10 339.8 µs 691.8 µs -50.88%
❌ CPU Simulation wait 500ms 29.5 ms 52 ms -43.22%
❌ CPU Simulation wait 1sec 59 ms 93.8 ms -37.06%
❌ CPU Simulation test_recursive_cached_fibo_10 49.3 µs 65.4 µs -24.71%
❌ CPU Simulation test_recursive_cached_fibo_20 64.3 µs 80.1 µs -19.72%
❌ CPU Simulation test_recursive_cached_fibo_30 72 µs 87.8 µs -17.94%
❌ Walltime switch 2 84 ns 96 ns -12.5%
❌ Walltime switch 2 108 ns 120 ns -10%
⚡ Memory one 2 KB 1.3 KB +48.24%
⚡ Memory count is back to zero 2.1 KB 1.5 KB +44.09%
⚡ Memory wait 1sec 28.7 KB 22.1 KB +29.49%
⚡ CPU Simulation wait 500ms 38.7 ms 30.1 ms +28.53%
⚡ Memory wait 1sec 27.5 KB 22 KB +24.96%
⚡ Walltime test sync baz 10 144 ns 120 ns +20%
⚡ CPU Simulation wait 1sec 72.9 ms 61.3 ms +19.02%
⚡ Walltime test sync baz 100 252 ns 228 ns +10.53%
⚡ Walltime test_iterative_fibo_10 132 ns 120 ns +10%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-4028-use-predictable-gc-schedule-in-codspeed-node-for-memory (6925940) with main (727b808)

Open in CodSpeed

Footnotes

  1. 56 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩