perf: 5-7x faster packing, 15-20% faster extraction#414
Merged
MarshallOfSound merged 7 commits intomainfrom Mar 28, 2026
Merged
perf: 5-7x faster packing, 15-20% faster extraction#414MarshallOfSound merged 7 commits intomainfrom
MarshallOfSound merged 7 commits intomainfrom
Conversation
1c54d50 to
3828e06
Compare
… block boundary bugs Added 81 robustness tests that uncovered three bugs: - Pickle resize allocated wrong buffer size, causing RangeError on large headers - writeFileListToStream/streamFilesystem didn't await stream flush before returning - Integrity hash emitted spurious empty block when file size hit exact 4MB boundary Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ility Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Under Electron, node:fs intercepts .asar paths as virtual archives. Tests that read/write raw .asar files need original-fs via wrappedFs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Key optimizations: - Buffer-based integrity hashing for files ≤2MB (avoids stream setup overhead) - Batched writes in writeFileListToStream (single write instead of per-file) - Bulk archive read in extractAll (one readSync for entire data section) - Synchronous fast path in insertFile (eliminates Promise allocation per file) - Set-based lookups for ordering and unpackDirs (O(1) vs O(n)) - Parallel metadata resolution in createPackageFromFiles - Optimized crawl symlink filter with early exit Adds benchmark suite (yarn benchmark / yarn benchmark:quick). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3828e06 to
e4cee09
Compare
erickzhao
reviewed
Mar 26, 2026
erickzhao
approved these changes
Mar 28, 2026
|
🎉 This PR is included in version 4.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
yarn benchmark)What changed
out.writeinstead of one per file)readSyncof entire data section inextractAllinsertFile(no Promise per file)Set-based lookups for ordering and unpackDirscreatePackageFromFilesBenchmark results (10,000 × 256B files)
Test plan
🤖 Generated with Claude Code