Skip to content

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

Closed
joaocgreis wants to merge 1 commit into
isaacs:masterfrom
joaocgreis:joaocgreis-J9K-filemapping
Closed

joaocgreis wants to merge 1 commit into
isaacs:masterfrom
joaocgreis:joaocgreis-J9K-filemapping

Conversation

@joaocgreis

Copy link
Copy Markdown
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

isaacs commented Sep 26, 2019

Copy link
Copy Markdown
Owner

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
Copy Markdown
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