Repository navigation
Conversation
Sparkplug+ patches calls in Sparkplug baseline code to typed builtins based on the feedback it observes. V8 compiles it in only when V8_ENABLE_SPARKPLUG_PLUS is defined, which its gn build does on x64, arm64 and loong64. Node's gyp files never defined it, so --sparkplug-plus was a read-only flag fixed to false. V8 only uses Sparkplug+ when short builtin calls are enabled, because it patches pc-relative calls. Enable it on those architectures when short builtin calls are enabled, which Node does by default on x64, and add --v8-disable-sparkplug-plus to opt out. Assisted-by: Claude Code Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
Collaborator
|
Review requested:
|
gurgunday
marked this pull request as ready for review
November 6, 2026 12:32
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.
Sparkplug+ patches calls in Sparkplug baseline code to typed builtins based on the feedback it observes. V8 compiles it in only when V8_ENABLE_SPARKPLUG_PLUS is defined, which its gn build does on x64 arm64 and loong64
Node's gyp files never defined it so --sparkplug-plus was a read-only flag fixed to false
Sparkplug+ became the default in V8 15.4, which is Chrome 154
For more information on Sparkplug+: https://youtu.be/LpJ79MxplUk?t=2638
V8 only uses Sparkplug+ when short builtin calls are enabled because it patches pc-relative calls. Therefore this PR enables it only when short builtin calls are enabled, which Node does by default on x64
On arm64 and loong64, V8 only allows short builtin calls with pointer compression, which Node doesn't use so I left it out
Also, this PR's combination of short builtin calls and Sparkplug+ without pointer compression is already tested upstream
I tested on an Apple silicon MacBook but Sparkplug+ stays off in that configuration. I couldn't run or benchmark the x64 build locally, so x64 coverage comes from CI, and we can run the benchmark CI on x64
What benefits from Sparkplug+
Within those functions, Sparkplug+ speeds up the patched operations:
+,*, bitwise)===,<)obj.x)Each patch replaces a generic stub with one specialized for the types actually seen
Workloads that look like this
lib/that runs for everyrequire/import,pathhandling,fswrappers and so on