-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
Proposal for a benchmark execution goal with JVM implementation #19172
base: main
Are you sure you want to change the base?
Conversation
What do |
I only looked a bit into a few impls in Bazel and it seems the approach the contributors are following are to execute them with the For example:
Haven't found any support at all in Buck. Please does support Go benchmarks via a specific target named So support is very patchy. This is obviously something not standardized across language toolchains and much less on monorepo build tools. |
4b431ee
to
aca46ed
Compare
1dbb1d8
to
d9b8084
Compare
This PR adds a new main goal to Pants under the alias
bench
(or may be better to put it underexperimental-bench
) with the sole purpose to execute microbenchmaks.The PR provides as well an implementation for the JVM based on JMH (the most popular framework) and Scalameter.
The core goal implementation is blatantly inspired on the
test
goal (removing support for coverage data and debugging), and, if adding a new goal is considered unnecessary, the implementations could switch to be based offtest
instead. There is no consensus among developers of different communities and tooling on whether benchmarks are just tests or if they are a separate thing all together. For example in Go the standard is to usego test -bench=.
while in Rust the command used iscargo bench
.The choice of putting them as separate comes from preventing unnecessary wait times when running tests (and not being aware that benchmarks are among those) and making the end user be intentional about their purpose. Happy to get rid of the goal though if we find that it as bloat.
The rest of the implementation follows a similar pattern as the one used for supporting JUnit: Having support for running JMH benchmarks in the 3 JVM languages supported with an extra for Scalameter.
tailor
implementation is not based on a general consensus either, the choice of usingBenchmark
as a suffix for JMH andBench
for Scalameter is just made for convenience.[ci skip-build-wheels]
[ci skip-rust]