src: avoid copying SEA snapshot data - #65876
Conversation
|
Review requested:
|
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
e9e9b50 to
ab51407
Compare
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65876 +/- ##
=======================================
Coverage 89.98% 89.99%
=======================================
Files 784 784
Lines 268361 268373 +12
Branches 51117 51123 +6
=======================================
+ Hits 241478 241512 +34
+ Misses 17438 17425 -13
+ Partials 9445 9436 -9
π New features to boost your workflow:
|
|
cc @nodejs/single-executable |
Signed-off-by: Colin McDonnell <3084745+colinhacks@users.noreply.github.com>
ab51407 to
f385b3e
Compare
Commit Queue failedThe pull request was removed from the Commit Queue and labeled
commit-queue-failed
Full Commit Queue output |
Description
SEA snapshots live in a resource mapped from the executable. Node.js currently copies the V8 startup data out of that resource when it loads the snapshot.
This change lets V8 read the data in place. Snapshots loaded from a file or through the embedder API still use a copy because those buffers may not live long enough.
Benchmark
Median of 240 launches in randomized order, after 30 warmups. Linux x64 on an Intel Xeon Platinum 8481C. Both executables were built from
6f41e415639b5ec3dd816e44945cc73b4d7651e3.Validation
make lint-cpppython3 tools/test.py --mode=release seamake -j22 test-onlyAI disclosure: I used a coding agent for the investigation, patch, benchmarks, and PR text. It checked the resource lifetime against the source, built Node.js, and ran the tests above. I approved the PR and will handle review comments myself.