chore(bench): disable mimalloc purge delay for codspeed cpu simulation#274
Conversation
Mimalloc delayed purging can call clock_gettime during CPU simulation measurements, adding allocator timing noise to CodSpeed stage benchmarks. Set MIMALLOC_PURGE_DELAY=-1 on the simulation run to keep that noise out while leaving memory runs unchanged.
There was a problem hiding this comment.
Pull request overview
This PR updates the benchmark CI workflow to reduce allocator-related timing noise during CodSpeed CPU (simulation) benchmarks by disabling mimalloc’s delayed purge behavior for that run only.
Changes:
- Set
MIMALLOC_PURGE_DELAY=-1for the CodSpeed CPU benchmark step (mode: simulation) to avoidclock_gettimenoise from delayed purging. - Leave the memory benchmark step unchanged to preserve existing behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughThis PR adds the environment variable 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Why
Mimalloc delayed purging can call
clock_gettimeduring CPU simulation measurements, leaking allocator timing noise into CodSpeed stage benchmarks. SettingMIMALLOC_PURGE_DELAY=-1on the simulation run keeps that noise out while leaving the memory run unchanged.Ports web-infra-dev/rspack#14321 to this repo. Only the CI workflow change applies here — there is no
bench:rust:localscript orxtask/benchmark/README.mdto mirror.This repo uses mimalloc as the global allocator in
benches/resolver.rs, so the same purge-noise concern applies.