Skip to content

fix(valgrind): stop excluding the node executable from callgrind - #617

Draft
not-matthias wants to merge 2 commits into
mainfrom
cod-4155-remove-obj-skip-for-codspeed-node
Draft

not-matthias wants to merge 2 commits into
mainfrom
cod-4155-remove-obj-skip-for-codspeed-node

Conversation

@not-matthias

@not-matthias not-matthias commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Fixes COD-4155.

1. Stop excluding the node executable

The runner ran node -e 'console.log(process.execPath)' and added the result to callgrind's ignored objects. Node runtime cost was then missing from simulation profiles. Remove get_node_objects so the node executable is instrumented.

2. Pass --separate-callers=all --pop-on-jump to callgrind

With node instrumented, V8 builtins (Call*, CallFunction*, bytecode handlers) sit between most pairs of JS functions. As single nodes they join every JS caller to every JS callee and form false cycles in the flame graph. --separate-callers=all names every function by its whole call stack, so unrelated chains stay apart; --pop-on-jump makes tail jumps replace the jumping frame, which keeps those stacks shallow.

Dependencies:

Companion change in codspeed-node removes the matching callgrindAddObjSkip(process.execPath) call: CodSpeedHQ/codspeed-node#121

@codspeed

codspeed Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 7 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 50 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing cod-4155-remove-obj-skip-for-codspeed-node (ae6049f) with main (2e709d9)

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Pass --separate-callers=all --pop-on-jump to callgrind. With the node
executable instrumented, V8 builtins sit between most pairs of JS
functions; as single nodes they join every JS caller to every JS callee
and form false cycles. Whole-stack contexts keep the chains apart, and
--pop-on-jump keeps tail-jump chains (bytecode handler dispatch) from
nesting.

Requires a valgrind-codspeed release with --separate-callers=all
(CodSpeedHQ/valgrind-codspeed#63).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant