Repository navigation
jsg: skip the fast-callback preamble and restore FastOneByteString - #7695
Open
littledivy wants to merge 1 commit into
Open
littledivy wants to merge 1 commit into
littledivy wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
littledivy
force-pushed
the
littledivy/2026-10-11-fast-api-no-scope
branch
from
October 11, 2026 09:47
ad5b3eb to
82b7ff4
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
littledivy
force-pushed
the
littledivy/2026-10-11-fast-api-no-scope
branch
from
October 11, 2026 09:53
82b7ff4 to
e8fe089
Compare
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.
I was digging into the JSG fast API implementation and found some overhead to remove. Skimming through the git history, it might be enough to make enabling fast calls worth another look.
This patch includes two changes:
v8::Localarguments. If a method takes nothing but primitives and strings then there is nothing to unwrap, so none of it is needed.FastOneByteString. It was removed in remove v8::FastOneByteString support #4628 because its data pointer dies on the next GC and unwrapping another argument could trigger one first. For these signatures no argument calls into V8 at all, so nothing can GC before we copy the bytes.Ran
//src/workerd/jsg:bench-dispatchwith--config=benchmarkand 3 reps:NativeDispatchFastNativeDispatchFastArgI also measured
Headerslocally:hassetdeleteI will open follow up PRs that apply the same optimizations to the preamble in the 10 other
fastCallbackdefinitions.