Repository navigation
Avoid duplicate browser migration archive copy - #4500
Merged
Merged
Conversation
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This is a narrowly scoped optimization that removes an intermediate browser byte-array copy while preserving archive limits and returned data, with focused regression coverage. Because it changes the production browser migration reader, human review is required for this migration-path change. You can add or adjust custom eligibility rules. Learn more. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## self-hosted #4500 +/- ##
===============================================
+ Coverage 87.91% 87.93% +0.02%
===============================================
Files 549 549
Lines 104073 104073
===============================================
+ Hits 91497 91518 +21
+ Misses 12576 12555 -21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Browser archive reads make a second JavaScript byte-array copy before copying the bytes into WASM memory. Use a checked Uint8Array cast to remove that allocation and save up to 100 MB per read. The 100,000,000-byte file limit, returned bytes, and byte-based import API stay unchanged.
Extend the existing boundary test to observe real typed-array constructor copies. It fails on the old reader and passes on this change. The full Browser migration suite and Rust/JavaScript formatting pass. The tested source and 259 staged assets plus five shipping artifacts remain unchanged.
This follows the merged migration PR #4455.
Note
Avoid duplicate
Uint8Arraycopy in wasm migration archive readerIn wasm.rs,
readno longer builds a new JavaScriptUint8Arrayfrom the value returned byread_output. It downcasts that value directly toUint8Arrayand converts it to a Rust vector.Behavioral Change: values that fail the downcast now return the mapped output error instead of being wrapped in a new array.
Macroscope summarized b19684f.