Repository navigation
ci: Compile benchmarked code before CodSpeed measures it - #315
Merged
Merged
Conversation
CodSpeed's simulation measures a single call after a fixed warm-up, so V8 compiling baseline code within that call skewed results. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review.
|
Zaimwa9
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CodSpeed's simulation mode runs each benchmark 7 times to warm up, then measures a single call with V8's optimising compilers disabled. V8 compiles a function to baseline (Sparkplug) code once it has run enough times, which can happen inside that measured call. Results then depend on when the compile lands, not on the SDK's code. In #314 this shows up as a regression in
small environment::getEnvironmentFlags, even though the call is ~3× faster in steady state.Changes
--always-sparkplug, so V8 compiles baseline code on a function's first call, before the measured call.How did you test this code?
Reproduced CodSpeed's measurement locally with its V8 flags (7 warm-ups, GC, one timed call), 5 runs per branch, for
small environment::getEnvironmentFlags:main--always-sparkplugAlso checked that
test.execArgvis passed alongside the flags the CodSpeed plugin sets.🤖 Generated with Claude Code