Skip to content

unpack: conditionally use a file mapping to write files #230

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

Closed

Conversation

joaocgreis
Copy link
Contributor

Use a file mapping to write files up to 512KB.

The limit where using a file mapping stops being an advantage varies from machine to machine. 512KB is a reasonable value to use here, close to the lower bound, to avoid tar becoming slower in some machines.

This is an alternative to #227 and also makes npm/pacote#8 unnecessary.

cc @isaacs

Use a file mapping to write files up to 512KB. The limit where using
a file mapping stops being an advantage varies from machine to
machine. 512KB is a reasonable value to use here, close to the lower
bound, to avoid tar becoming slower in some machines.
@isaacs
Copy link
Owner

isaacs commented Sep 26, 2019

Published to 5.0.1, and extracted to a separate module in 97f813a so that it could get better test coverage. I prefer to avoid using /* istanbul ignore next */ unless absolutely necessary (ie, throw new Error('impossible') in code paths that we expect to be unreachable).

@joaocgreis
Copy link
Contributor Author

Thanks @isaacs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants