Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/introspection.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Analysis-mode V8 flags

Simulation (including the `instrumentation` alias) and memory mode use
`--always-sparkplug` to compile eligible JavaScript functions directly to baseline
machine code instead of waiting for V8's tiering and batch-compilation thresholds.
This reduces sensitivity to unrelated code triggering compilation before a
benchmark is measured. TurboFan remains disabled with `--no-opt`, and Maglev is
explicitly disabled on Node.js 24 and newer.

This changes the measurement baseline compared with earlier releases. It does not
isolate inline-cache feedback from other benchmarks. Walltime flags are unchanged.

## Testing introspection locally

1. Inside `codspeed-node` directory, run `export PATH="$pwd/../action/dist/bin:$PATH"`.
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/introspection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const getV8Flags = () => {
"--hash-seed=1",
"--random-seed=1",
"--no-opt",
"--always-sparkplug",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

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!

Fix in Claude Code Fix in Codex

"--predictable",
"--predictable-gc-schedule",
"--expose-gc",
Expand Down
Loading