Skip to content

Avoid copying file-backed V8 snapshot blobs during startup #67600

Open

Description

@jdalton

Node's --snapshot-blob path currently copies the V8 payload while reading a snapshot file in SnapshotData::FromFile. For large snapshots, that adds startup copying and increases peak memory.

I have a prototype on the vsl-node-snapshot-launcher fork branch. It keeps the file buffer alive on SnapshotData and gives V8 a non-owning view of the existing bytes, while retaining Node's current snapshot validation and error handling. Would this ownership approach fit Node's snapshot loading model?

Prototype and validation

The branch changes SnapshotData::FromFile to retain the file bytes for the lifetime of the V8 startup data and avoid making a second copy of the V8 payload.

No Node build or tests have been run yet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions