MOD-17912 Improve get_index performance - #1631
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1631 +/- ##
=======================================
Coverage 85.97% 85.97%
=======================================
Files 15 15
Lines 5305 5306 +1
=======================================
+ Hits 4561 4562 +1
Misses 744 744 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TalBarYakar
approved these changes
Aug 23, 2026
This was referenced Aug 23, 2026
AvivDavid23
added a commit
that referenced
this pull request
Aug 23, 2026
* MOD-17912 Improve `get_index` performance * fmt (cherry picked from commit 21568f4)
AvivDavid23
added a commit
that referenced
this pull request
Aug 23, 2026
* MOD-17912 Improve `get_index` performance * fmt (cherry picked from commit 21568f4)
AvivDavid23
added a commit
that referenced
this pull request
Aug 23, 2026
* MOD-17912 Improve `get_index` performance * fmt (cherry picked from commit 21568f4) Test adapted to the 8.6 SelectValue API: get_long/get_double/as_str are non-Option there, and JSONArrayType/get_array_type (V7 getArray, 8.8+) do not exist, so the packed-array assertion uses ijson's ArraySliceRef::is_typed.
AvivDavid23
added a commit
that referenced
this pull request
Aug 23, 2026
* MOD-17912 Improve `get_index` performance * fmt (cherry picked from commit 21568f4) Test adapted to the 8.4 SelectValue API: get_long/get_double/as_str are non-Option there, and JSONArrayType/get_array_type (V7 getArray, 8.8+) do not exist, so the packed-array assertion uses ijson's ArraySliceRef::is_typed.
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.
Note
Low Risk
Localized performance change to JSON array indexing with tests; no auth, data, or API contract changes. Typed elements now return owned values instead of iterator-produced ones, which should be equivalent.
Overview
Makes
SelectValue::get_indexforIValueO(1) on typed arrays instead of walking (and allocating) viaiter().nth, which made full scans quadratic.Indexing now uses the backing
ArraySliceRefdirectly: heterogeneous arrays stay borrowed, typed numeric slices wrap the element in an ownedIValue. Adds a unit test covering heterogeneous, F32, and I64 arrays plus out-of-range / non-array cases.Also pins
rust-analyzerinrust-toolchain.toml.Reviewed by Cursor Bugbot for commit 6366955. Bugbot is set up for automated code reviews on this repo. Configure here.