Rust Benchmark Rule #930
Replies: 4 comments 8 replies
-
I'm wondering what is the value rust_benchmark rule adds here. I don't think passing benchmark arguments through rule attributes is all that generally useful, benchmarks often run in special environments, at special times, with different configurations. The benchmarking infrastructure traces the excution and collects data, draws plots and generates flamegraphs. Bazel will not be able to be customized to support all of that. I'd vote for removing the rule and instead only use rust_binary for these use cases. |
Beta Was this translation helpful? Give feedback.
-
Hmm, wouldn't it make sense in a cargo-raze context? I was actually planning to use this, assuming its behavior matches |
Beta Was this translation helpful? Give feedback.
-
When using Cargo, Further, I agree that benchmarks ideally run in a controlled environment, and that might not be easy to do within Bazel. However, I'd like to be able to at least build the benchmark executables so that they can be transported to the controlled environment and run there. E.g. transfered to a physical Android reference device and run. Also, in practice people get pretty good results running benchmarks on their local systems, and it would be very nice to be able to keep doing this, if we were to switch from Cargo to Bazel. |
Beta Was this translation helpful? Give feedback.
-
Good points! Bazel definitely has to be able to build benchmarks, and it also has to be able to run them. Both The question I have is if we need a custom In my experience using I'm happy to discuss concrete use cases in detail, for example @briansmith mentioned they need to be able to build all benchmarks. Is it an option to communicate this information to the benchmarking library via an environment variable that would be set during the CI build? |
Beta Was this translation helpful? Give feedback.
-
There's currently a rust_benchmark rule as part of the core package for
rules_rust
. I'd revived a PR to fix it up (#923) but I'm not actually sure what a benchmarking rule would do. Is there prior-art for this in Bazel? I'd love to hear about existing or potential use cases.Beta Was this translation helpful? Give feedback.
All reactions