Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4360 +/- ##
=======================================
Coverage 98.81% 98.81%
=======================================
Files 59 59
Lines 12139 12197 +58
Branches 2310 2318 +8
=======================================
+ Hits 11995 12053 +58
Misses 70 70
Partials 74 74 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
merge()adds the named destinations of the appended document one at a time. For each one it checkstitle in namesand thenadd_named_destination_array()scans the array again to find where to insert, so a document with many named destinations takes quadratic time.For documents with at least 32 named destinations, the string entries now go into a set for the lookup. If the existing keys are sorted, the new destinations are collected and sorted into the array once at the end. Putting each one before the first greater key, as
add_named_destination_array()does, gives the same order as that stable sort. Arrays with unsorted keys still use the old insertion, and documents with fewer destinations keep the old code, since building the index reads the whole array.writer.append(reader)with all destinations on one page:The resulting
/Namesarrays and written files are the same as on main in about 1,300 generated cases (unsorted and odd-length arrays, indirect arrays, byte string keys,clone_fromwriters, appending the same file twice), and appending many small documents into a large array is as fast as before.AI assistance: Claude Code (Claude Opus 5.5) helped write and measure this, and Codex (GPT-6 Astra) reviewed it. I reviewed the change and ran the test suite.