fix: improve pack performance by not reading into memory#8664
Open
BridgeAR wants to merge 1 commit intonpm:latestfrom
Open
fix: improve pack performance by not reading into memory#8664BridgeAR wants to merge 1 commit intonpm:latestfrom
BridgeAR wants to merge 1 commit intonpm:latestfrom
Conversation
The current implementation is very slow due to having to load all into memory before writing the file. Pacote itself has a command that does that right away. This improves the performance significantly.
Member
|
The reason the test fails is because the code is failing. The file is created but it's empty. npm crashes when pacote.tarball.file eventually returns from {
integrity: 'sha512-...',
resolved: '/path',
from: 'file:/path'
}via writer.on('close', () => res({
integrity: this.integrity && String(this.integrity),
resolved: this.resolved,
from: this.from,
}))Instead of the tarballStream. |
Author
|
I believe the issue is around the return of the pack call. I do not think it should return the tarball in memory, which is a breaking change for this module. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current implementation is very slow due to having to load all into memory before writing the file. Pacote itself has a command that does that right away as a stream. This improves the performance significantly.
Fixing the test case seemed more tricky than the fix, so I hope you could suggest what to do about the test.