benchmark: add child_process async path baselines#63929
Open
anonrig wants to merge 1 commit into
Open
Conversation
Add micro-benchmarks that isolate the hot paths targeted by the JavaScript-to-C++ migration of child_process: - child-process-spawn-options.js scales the env vars and args that ProcessWrap::Spawn must marshal across the JS/C++ boundary. - child-process-ipc-roundtrip.js measures IPC throughput for both the json and advanced serializers across a range of payload sizes. - child-process-exec-maxbuffer.js measures stdout accumulation and maxBuffer handling in execFile(). These establish the baseline that later migration PRs are compared against. There is no runtime behavior change. Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
Collaborator
|
Review requested:
|
panva
approved these changes
Jun 15, 2026
Collaborator
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.
Add micro-benchmarks that isolate the hot paths of the
child_processasyncimplementation, establishing a baseline ahead of an incremental effort to move
those paths from JavaScript to C++ for performance.
Three new benchmarks under
benchmark/child_process/:child-process-spawn-options.js— spawns a trivial, fast-exiting childrepeatedly while scaling the number of environment pairs and arguments, so the
per-spawn option marshaling done in
ProcessWrap::Spawndominates the measuredcost. Params:
n,envc(0–1024),argc(0–64).child-process-ipc-roundtrip.js— measures IPC round-trip throughput forboth the
jsonandadvancedserializers across a range of payload sizes,keeping a window of in-flight messages so both the serialize (write) and
deserialize (read) paths stay saturated. Params:
len(64–65536),serialization(json/advanced),dur.child-process-exec-maxbuffer.js— measures stdout accumulation andmaxBufferhandling inexecFile()by reading a fixed, large amount of childoutput into the result buffer. Params:
chunks(1–64 MiB),n.The benchmarks are intentionally black-box (real processes / real IPC) rather
than coupled to internal serialization APIs, so they remain valid as the
internals are refactored in follow-ups.
There is no runtime behavior change.