
Two things stand between a benchmark and the truth: costs that don't match real
hardware, and noise that isn't your code. CodSpeed v5 tackles both. Cycle
estimation, now on by default, weights each executed instruction by its measured
cost on real CPUs, so a div no longer counts the same as a mov. And the new
allocation exclusion removes allocator time from your results entirely. Only
your code, at its real cost, with the same single-run determinism.
The simulation estimates the total cycles of a benchmark from three components:
You keep everything that makes Simulation mode useful: benchmarks run once, on standard CI runners, with deterministic results. The estimate just tracks real hardware much more closely. Learn more in the CPU Simulation docs.
Allocators are one of the most common sources of benchmark variance: their cost
depends on the OS, the allocator implementation, and its version. If you are
optimizing your own code, that cost is noise. With the new opt-in
exclude-allocations feature, CodSpeed tags every allocator frame in the call
graph and subtracts its time from the reported value. The flame graph still
shows the allocator frames, only the reported number changes.
Enable it with the CLI:
codspeed run --exclude-allocations -- <your bench command>
Or in GitHub Actions:
- uses: CodSpeedHQ/action@v5
with:
mode: simulation
exclude-allocations: true
run: <your bench command>
Learn more in the allocation exclusion docs.
The walltime profiler now uses our
fork of samply on all operating
systems, not just macOS. You get the same high-quality stacks and symbol
resolution on Linux as on macOS. If you need the previous behavior, set
CODSPEED_WALLTIME_PROFILER=perf.
To upgrade, bump the action in your workflow:
- uses: CodSpeedHQ/action@v5
Or update the CLI:
curl -fsSL https://codspeed.io/install.sh | bash
Since the cycle estimation formula changes what Simulation mode measures, runs made with v5 are not comparable with runs from earlier versions. CodSpeed detects this and marks cross-version comparisons as N/A instead of showing a misleading diff. Your first run on v5 becomes the new baseline.
Full release notes on GitHub.