sea: add support for V8 bytecode-only caching#48191
Conversation
|
Review requested:
|
joyeecheung
left a comment
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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. |
Refs: https://github.com/nodejs/node/pull/48191/files/300f3f4a03d7f418fb565a479f19b67c22d80a07#r1269601154 Signed-off-by: Darshan Sen <raisinten@gmail.com>
Signed-off-by: Darshan Sen <raisinten@gmail.com>
300f3f4 to
91bf2df
Compare
|
Done @joyeecheung, PTAL |
This comment was marked as outdated.
This comment was marked as outdated.
|
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