-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
sea: add support for V8 bytecode-only caching #48191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Review requested:
|
It expresses the intent in a clearer way. Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
joyeecheung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this includes any tests for the new feature? We should at least have some to exercise the code paths..
This change generates the code cache and uses it by default, so the existing E2E SEA tests should already be exercising the added code paths, right? |
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great! I left some nits
(One last note wrt startup time: it's unfortunate that we store the source code as UTF8 because then we need to transcode/copy it into Latin1/UTF16 in order to actually put it into V8. Ideally we'd use external strings instead. That's not really related to this diff, but thought I'd note it since we're one the subject. :)
I think this could be made configurable because storing the strings as UTF8 could save quite some space if the source actually contains two-byte characters, which may be more important to users than the startup cost depending on their use case. |
Original commit message:
[compiler] fix CompileFunction ignoring kEagerCompile
v8::ScriptCompiler::CompileFunction was ignoring kEagerCompile. Unlike
the other functions in v8::ScriptCompiler, it was not actually
propagating kEagerCompile to the parser. The newly updated test fails
without this change.
I did some archeology and found that this was commented out since the
original CL in https://crrev.com/c/980944.
As far as I know Node.js is the main consumer of this particular API.
This CL speeds up Node.js's overall startup time by ~13%.
Change-Id: Ifc3cd6653555194d46ca48db14f7ba7a4afe0053
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4571822
Commit-Queue: Marja Hölttä <[email protected]>
Reviewed-by: Marja Hölttä <[email protected]>
Cr-Commit-Position: refs/heads/main@{#87944}
Refs: v8/v8@cb00db4
Refs: nodejs#48191 (comment)
Signed-off-by: Darshan Sen <[email protected]>
It expresses the intent in a clearer way. Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <[email protected]>
|
Landed in 6cd6789 |
This improves the startup performance of SEAs.
For example, the comparison of the startup performance benchmarks of a Node.js SEA built using the CJS bundle of Yarn's source code shows a 24% improvement on my
x86_64macOS:Fixes: nodejs/single-executable#73
cc @kvakil