Repository navigation
fix(core): compile analysis workloads eagerly with sparkplug - #104
not-matthias wants to merge 1 commit into
Conversation
Avoid dependence on Sparkplug tiering and compilation batches during analysis measurements. Keep optimizing compilers disabled and walltime unchanged. Document the baseline shift and remaining inline-cache sensitivity.
[Medium impact] The change affects CodSpeed’s analysis-mode benchmark runs. The change appears safe to merge, with non-blocking follow-ups for consistent runner flags and regression tests.
|
| "--hash-seed=1", | ||
| "--random-seed=1", | ||
| "--no-opt", | ||
| "--always-sparkplug", |
There was a problem hiding this comment.
Runner compilation settings diverge
Adding --always-sparkplug here leaves the companion codspeed exec wrapper using the old analysis flags. Its flag list mirrors getV8Flags() but does not read it. Update that wrapper alongside this change so codspeed exec and plugin-driven runs use the same compilation settings.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/introspection.ts
Line: 23
Comment:
**Runner compilation settings diverge**
Adding `--always-sparkplug` here leaves the companion `codspeed exec` wrapper using the old analysis flags. Its [flag list](https://github.com/codspeedhq/codspeed/blob/HEAD/crates/exec-harness/src/runtime_env/node/node.sh#L47-L73) mirrors `getV8Flags()` but does not read it. Update that wrapper alongside this change so `codspeed exec` and plugin-driven runs use the same compilation settings.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| "--hash-seed=1", | ||
| "--random-seed=1", | ||
| "--no-opt", | ||
| "--always-sparkplug", |
There was a problem hiding this comment.
Existing tests compare configured flags with another call to getV8Flags(), so they would still pass if this line disappeared or moved into the wrong mode. Add focused assertions that simulation, instrumentation, and memory include --always-sparkplug, while walltime and disabled mode exclude it.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/introspection.ts
Line: 23
Comment:
**New flag lacks direct tests**
Existing tests compare configured flags with another call to `getV8Flags()`, so they would still pass if this line disappeared or moved into the wrong mode. Add focused assertions that simulation, instrumentation, and memory include `--always-sparkplug`, while walltime and disabled mode exclude it.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Merging this PR will regress 44 benchmarks3 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Add
--always-sparkplugto analysis-mode V8 flags so eligible functions compile directly to baseline machine code instead of depending on tiering and shared compilation batches. This reduces sensitivity to unrelated benchmark setup changing when compilation happens.Simulation (including the instrumentation alias) and memory mode are affected. TurboFan and Maglev remain disabled; walltime is unchanged. Existing measurements will shift baseline, and inline-cache feedback remains shared.
Verified on Node 24.21.0 using the actual generated flags: a first-call function has BASELINE code in all three analysis-mode aliases. Walltime and disabled mode do not receive the flag. Core typecheck, lint, and formatting passed; the core unit-test command found no tests. The full build was blocked by missing native instrument-hook headers (
hooks/includes/core.h). Real-runner variance measurements are still needed before merging; this PR does not claim to reproduce the reported benchmark improvement.