Skip to content
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

Fix rust benchmark #923

Merged
merged 8 commits into from
Sep 8, 2021
Merged

Conversation

UebelAndre
Copy link
Collaborator

@UebelAndre UebelAndre commented Sep 1, 2021

This is a revival of #532 (Thanks @djmarcin!)

Changes

@google-cla google-cla bot added the cla: yes label Sep 1, 2021
@UebelAndre UebelAndre force-pushed the fix-rust-benchmark branch 9 times, most recently from 12fa172 to 034d550 Compare September 1, 2021 19:17
@UebelAndre UebelAndre marked this pull request as ready for review September 1, 2021 19:25
Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks reasonable - a few suggestions

util/bench/bench_runner.rs Show resolved Hide resolved
util/bench/bench_runner.rs Outdated Show resolved Hide resolved
examples/benchmarking/private/bench_runner.rs Outdated Show resolved Hide resolved
examples/benchmarking/libtest/BUILD.bazel Outdated Show resolved Hide resolved
examples/benchmarking/criterion/BUILD.bazel Outdated Show resolved Hide resolved
UebelAndre and others added 2 commits September 3, 2021 05:38
Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
@@ -13,7 +13,7 @@
# limitations under the License.

load("@rules_rust//rust:rust.bzl", "rust_benchmark")
load("//benchmarking/private:bench_runner.bzl", example_bench_runner_test = "bench_runner_test")
load("//benchmarking/private:example_bench_runner.bzl", "example_bench_runner_test")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, what I meant was to literally remove the example_bench_runner_test macro, and have a rust_test each place it's used...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I feel like the existence of it kinda crosses the line between example and integration test. I'd like it to be clear that the target there has nothing to do with the use of rust_benchmark but since I suspect the common use case is going to be criterion, which I kinda don't want to put in the test package, I opted to make this target. With that being said, I don't mind deleting the macro, I just want it to be clear that it's not something users should need to care about

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, I can probably move the tests outside each package...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case I'd be pretty tempted to move this to the test package - I don't really mind if we end up duplicating the actually rust_benchmark between examples and test...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up moving it. Should there still be something in examples? Also, I'm kinda unhappy about having a test with a bunch of external dependencies. I'd really hate for a test to fail because something happened to some network resource and don't want to have iteration loops where your test failed but to thoroughly test your changes you need to build a massive application. This particular case wouldn't qualify as "massive" to me but it is in comparison to the existing tests and introducing dependencies like this can be a slippery slope.

@UebelAndre UebelAndre merged commit 531053e into bazelbuild:main Sep 8, 2021
@UebelAndre UebelAndre deleted the fix-rust-benchmark branch September 9, 2021 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants