-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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 microbenchmark for LongKeyedBucketOrds #58608
Merged
Merged
Commits on Jun 26, 2020
-
Add microbenchmark for LongKeyedBucketOrds
I've always been confused by the strange behavior that I saw when working on elastic#57304. Specifically, I saw switching from a bimorphic invocation to a monomorphic invocation to give us a 7%-15% performance bump. This felt *bonkers* to me. And, it also made me wonder whether it'd be worth looking into doing it everywhere. It turns out that, no, it isn't needed everywhere. This benchmark shows that a bimorphic invocation like: ``` LongKeyedBucketOrds ords = new LongKeyedBucketOrds.ForSingle(); ords.add(0, 0); <------ this line ``` is 19% slower than a monomorphic invocation like: ``` LongKeyedBucketOrds.ForSingle ords = new LongKeyedBucketOrds.ForSingle(); ords.add(0, 0); <------ this line ``` But *only* when the reference is mutable. In the example above, if `ords` is never changed then both perform the same. But if the `ords` reference is assigned twice then we start to see the difference: ``` immutable bimorphic avgt 10 6.468 ± 0.045 ns/op immutable monomorphic avgt 10 6.756 ± 0.026 ns/op mutable bimorphic avgt 10 9.741 ± 0.073 ns/op mutable monomorphic avgt 10 8.190 ± 0.016 ns/op ``` So the conclusion from all this is that we've done the right thing: `auto_date_histogram` is the only aggregation in which `ords` isn't final and it is the only aggregation that forces monomorphic invocations. All other aggregations use an immutable bimorphic invocation. Which is fine. Relates to elastic#56487
Configuration menu - View commit details
-
Copy full SHA for 7e1371e - Browse repository at this point
Copy the full SHA 7e1371eView commit details
Commits on Jun 30, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 7c20cd4 - Browse repository at this point
Copy the full SHA 7c20cd4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9075f23 - Browse repository at this point
Copy the full SHA 9075f23View commit details
Commits on Jul 6, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 2e4fb47 - Browse repository at this point
Copy the full SHA 2e4fb47View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80ba140 - Browse repository at this point
Copy the full SHA 80ba140View commit details
Commits on Jul 8, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 6d26ed4 - Browse repository at this point
Copy the full SHA 6d26ed4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f46086 - Browse repository at this point
Copy the full SHA 0f46086View commit details -
Configuration menu - View commit details
-
Copy full SHA for dde47b2 - Browse repository at this point
Copy the full SHA dde47b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ab3390 - Browse repository at this point
Copy the full SHA 7ab3390View commit details -
Configuration menu - View commit details
-
Copy full SHA for d31dd30 - Browse repository at this point
Copy the full SHA d31dd30View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67b57db - Browse repository at this point
Copy the full SHA 67b57dbView commit details
Commits on Jul 13, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 308c982 - Browse repository at this point
Copy the full SHA 308c982View commit details -
Configuration menu - View commit details
-
Copy full SHA for f426b55 - Browse repository at this point
Copy the full SHA f426b55View commit details
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.