Use blit for contiguous copies#3560
Merged
Merged
Conversation
Collaborator
Coverage Report for CI Build 4263Coverage increased (+0.004%) to 94.641%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
ea4953b to
229af7d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request replaces several element-by-element copy loops with blit-based contiguous copies across core collection/bytes utilities to reduce overhead and avoid initialize-then-overwrite patterns, including in the stable-sort merge path.
Changes:
- HashSet: copy entries via
FixedArray::blit_toinstead of a manual loop. - Deque: introduce a small internal
unsafe_blit_tohelper and use it in concat (+),copy, andrealloclinearization paths. - Bytes + stable sort: use
make_uninit+UninitializedArray::unsafe_blit(_fixed)and bytes blit helpers for conversions/concat and TimSort merge buffering.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hashset/hashset.mbt | Uses blit_to to copy the backing entries array when cloning a HashSet. |
| deque/deque.mbt | Adds an internal linearization blit helper and uses it for concat/copy/realloc copies. |
| builtin/bytes.mbt | Switches bytes-to-array conversions and bytes concatenation to blit-based copies. |
| builtin/array_sort_impl.mbt | Replaces merge-buffer construction/copy-back loops with UninitializedArray blit operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Validation
No .mbti files changed.