-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre computing hash code for WeightedRouting to avoid recomputing it #13099
Conversation
WeightedRoutingKey is used as key in the HashMap to retreive the shard routings, for every usage the hash key is computed. WeightedRoutingKey internally uses WeightedRouting. As the number of the shards getting queried increases, the computation cost goes high. Computing the hash key during object creation as the object is immutable and using it through out the object thus saving on the additional computation. Signed-off-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com>
Compatibility status:Checks if related components are compatible with change 4c45acc Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/performance-analyzer.git] |
❕ Gradle check result for 4c45acc: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13099 +/- ##
============================================
+ Coverage 71.42% 71.47% +0.05%
- Complexity 59978 60432 +454
============================================
Files 4985 5026 +41
Lines 282275 284458 +2183
Branches 40946 41200 +254
============================================
+ Hits 201603 203316 +1713
- Misses 63999 64297 +298
- Partials 16673 16845 +172 ☔ View full report in Codecov by Sentry. |
…13099) WeightedRoutingKey is used as key in the HashMap to retreive the shard routings, for every usage the hash key is computed. WeightedRoutingKey internally uses WeightedRouting. As the number of the shards getting queried increases, the computation cost goes high. Computing the hash key during object creation as the object is immutable and using it through out the object thus saving on the additional computation. Signed-off-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com> (cherry picked from commit 8d9e12d) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…13099) (#13107) WeightedRoutingKey is used as key in the HashMap to retreive the shard routings, for every usage the hash key is computed. WeightedRoutingKey internally uses WeightedRouting. As the number of the shards getting queried increases, the computation cost goes high. Computing the hash key during object creation as the object is immutable and using it through out the object thus saving on the additional computation. (cherry picked from commit 8d9e12d) Signed-off-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com>
…pensearch-project#13099) WeightedRoutingKey is used as key in the HashMap to retreive the shard routings, for every usage the hash key is computed. WeightedRoutingKey internally uses WeightedRouting. As the number of the shards getting queried increases, the computation cost goes high. Computing the hash key during object creation as the object is immutable and using it through out the object thus saving on the additional computation. Signed-off-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
WeightedRoutingKey is used as key in the HashMap to retreive the shard routings, for every usage the hash key is computed. WeightedRoutingKey internally uses WeightedRouting. As the number of the shards getting queried increases, the computation cost goes high.
Computing the hash key during object creation as the object is immutable and using it through out the object thus saving on the additional computation.
Check List
[ ] New functionality includes testing.[ ] New functionality has been documented.[ ] New functionality has javadoc added[ ] Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)[ ] Commit changes are listed out in CHANGELOG.md file (See: Changelog)[ ] Public documentation issue/PR createdBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.