-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add singleton optimization for DateHistogramAggregator #17643
base: main
Are you sure you want to change the base?
Add singleton optimization for DateHistogramAggregator #17643
Conversation
❌ Gradle check result for 9c88ccd: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
distribution/src/config/jvm.options
Outdated
@@ -89,3 +89,5 @@ ${error.file} | |||
# See please https://bugs.openjdk.org/browse/JDK-8341127 (openjdk/jdk#21283) | |||
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.setAsTypeCache | |||
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.asTypeUncached | |||
|
|||
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have jvm debug port enabled by default? I think this will cause performance issues for production.
Hello! |
if you are expecting tangible performance improvements we recommend you to run a performance benchmark on your pull request, refer the README mentioned in the comment. Recommend you to use |
Signed-off-by: shreyah963 <[email protected]>
❌ Gradle check result for a1cade1: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
Optimized the 'DateHistogramAggregator' to provide a specialized fast path for single-valued date fields. This optimization reduces method call overhead and eliminates unnecessary iteration logic when processing single values.
Key Changes
Single-Value Optimization
DocValues.unwrapSingleton()
Before vs After Comparison
Before (Original Implementation):
After (Optimized Implementation):
Technical Details
Method Call Reduction:
advanceExact → docValueCount → nextValue → round
advanceExact → longValue
Memory Access Pattern:
Code Path Optimization:
Performance Impact
Backwards Compatibility
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.