Repository navigation
[To dev/1.3] [Performance] Pre-size collections with known cardinality (#18851) - #18854
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev/1.3 #18854 +/- ##
==========================================
Coverage 45.41% 45.41%
Complexity 198 198
==========================================
Files 3667 3667
Lines 251096 251115 +19
Branches 31089 31109 +20
==========================================
+ Hits 114038 114052 +14
- Misses 137058 137063 +5 ☔ 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.
Description
Backport #18851 (
a78f5a736c7e34a951fa1dda34a314fc8a47b7c9) todev/1.3by re-scanning this branch's production Java code and adapting the collection allocation optimization to its implementations.Collections with a known number of entries currently grow their backing arrays or hash tables while being filled. Pre-size 152 collections in 80 production Java files across six modules:
Use serialized counts or the number of outputs produced from the input. Guava expected-size factories account for the hash-table load factor. Optional empty lists use capacity zero; memtable schema-list sizing handles nullable measurement arrays.
The dev/1.3 scan includes its aggregation/device-view/templated plan deserialization and logical-view maps, and uses the branch's existing DataNode transformation, AuthorPlan, DeviceTimeIndex, and PipeConsensus implementations.
Validation
test-compilepassed for the affected modules and their dependencies (28 modules).test-compilepassed for the same 28 modules with-P with-zh-locale.git diff --cached --checkpassed.This PR has: