Date Histogram Optimization with Date Rounding utility refactoring#19088
Date Histogram Optimization with Date Rounding utility refactoring#19088jainankitk merged 5 commits intoopensearch-project:mainfrom
Conversation
|
{"run-benchmark-test": "id_4"} |
|
The Jenkins job url is https://build.ci.opensearch.org/job/benchmark-pull-request/4100/ . Final results will be published once the job is completed. |
|
❕ Gradle check result for 3e59154: 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 Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19088 +/- ##
============================================
+ Coverage 72.88% 72.95% +0.06%
- Complexity 69841 69848 +7
============================================
Files 5673 5673
Lines 320756 320750 -6
Branches 46370 46368 -2
============================================
+ Hits 233796 233993 +197
+ Misses 68102 67816 -286
- Partials 18858 18941 +83 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Benchmark ResultsBenchmark Results for Job: https://build.ci.opensearch.org/job/benchmark-pull-request/4100/
|
|
Hello! |
jainankitk
left a comment
There was a problem hiding this comment.
Thanks @sandeshkr419 for this change. The improvement looks impressive, but does make given the sheer number of times, nextRoundingValue gets invoked. Also going forward, it will be better to raise separate PRs for refactoring change and the proposed improvement.
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
3e59154 to
28207d8
Compare
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
…pensearch-project#19088) --------- Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
…pensearch-project#19088) --------- Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com> Signed-off-by: Ankit Jain <jainankitk@apache.org>
…pensearch-project#19088) --------- Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com> Signed-off-by: Ankit Jain <jainankitk@apache.org>
…pensearch-project#19088) --------- Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
…pensearch-project#19088) --------- Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
…pensearch-project#19088) --------- Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
Signed-off-by: Sandesh Kumar sandeshkr419@gmail.com
TLDR
Description
Re-using some rounding util objects to prevent unnecessary memory allocations. Classes like
JavaTimeToMidnightRoundingdo not contain any state objects and only expose utils for time rounding. Creating a new object of this class for each call does not make sense therefore, changing this to a final single object to be re-used later on.Difficult to establish results from pre-existing queries since a lot of queries do use pre-computations, which was evident as I profiled the results.
So, I created a date-histogram aggregation with sub-aggregation query which could not use pre-computations and I could hit the utils as intended.
This might not help speed up any non time-related aggregation request, because the benefits are seen only when the utils need to be called multiple times which is true only in cases of aggregation requests.
Query used to benchmark:
Compared query results manually and also gradle checks do have appropriate coverage for various query shapes that will consume these utils.
Could see good ~1.5-2x latency improvements in this case.
Before:
After:
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By 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.
Signed-off-by: Sandesh Kumar sandeshkr419@gmail.com