-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add microbenchmarking infrastructure #18891
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 microbenchmarking infrastructure #18891
Conversation
With this commit we add a benchmarks project that contains the necessary build infrastructure and an example benchmark. It is added as a separate project to avoid interfering with the regular build too much (especially sanity checks) and to keep the microbenchmarks isolated. Microbenchmarks are generated with `gradle :benchmarks:jmhJar` and can be run with ` gradle :benchmarks:jmh`. We intentionally do not use the [jmh-gradle-plugin](https://github.com/melix/jmh-gradle-plugin) as it causes all sorts of problems (dependencies are not properly excluded, not all JMH parameters can be set) and it adds another abstraction layer that is not needed. Closes elastic#18242
@rjernst: I pushed initial support for microbenchmarking but I have two specific issues with For some reason transitive dependencies of JMH don't get picked up, so I added them explicitly in the meantime.
As you can see above, in the The next issue is that JMH generates classes during the build and uses all sorts of tricks which - you might have guessed it - alert our forbidden API check. I have tried various approaches, like a custom |
Since this is for developer use only and will not be shipped, I don't think we need to go through a formal review process. I suggest that we merge it and then iterate directly on master? |
I agree with @jpountz that since this is just for developers, I think we should just get it in to start, and iterate. I do actually think we should do this more tightly integrated in the build (eg, as a Regarding transitive dependencies: |
@rjernst: Thanks for your explanation. Then I think we're good to start now. Just as a general note: While this allows us now to benchmark on our machines, CI integration is not yet done but I'll work together with the infra team on that soon. |
With this commit we add a benchmarks project that contains the necessary build infrastructure and an example benchmark. It is added as a separate project to avoid interfering with the regular build too much (especially sanity checks) and to keep the microbenchmarks isolated.
Microbenchmarks are generated with
gradle :benchmarks:jmhJar
and can be run withgradle :benchmarks:jmh
.We intentionally do not use the jmh-gradle-plugin as it causes all sorts of problems (dependencies are not properly excluded, not all JMH parameters can be set) and it adds another abstraction layer that is not needed.
Closes #18242