Skip to content

Use v8 serialized buffer instead of JSON for cache #9965

@zkochan

Description

@zkochan

Contribution

Describe the user story

Currently we use JSON to store the package metadata files in cache and the index files in the store. Instead of storing JSON we could store V8-serialized buffers. v8 serialize/deserialize is faster than parsing and stringifying JSON.

However, the buffer generated by one version of v8 is not compatible with another version of v8. As a result, the cache created by pnpm running on one Node.js version will not be compatible with pnpm running on another version of Node.js. So, we need to store this cache files per v8 engine version.

Describe the solution you'd like

.

Describe the drawbacks of your solution

No response

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions