-
Notifications
You must be signed in to change notification settings - Fork 226
Add support for cargo bench #421
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
Comments
Benchmarking on a cloud service provider is inherently a flaky proposition. There's no guarantee that the underlying CPU will be at a constant speed during a single benchmark run, much less between two benchmarks run sequentially or two completely separate executions. |
That's true. While discrepancy between separate benchmarks doesn't matter for the intended usage, variance in proportional performance sucks. Could running the generated WebAssembly of the benchmark on the client be a viable option? I do recognize that it is infinitely more work. |
That sounds like #374. It's certainly plausible, although I don't know enough of the particulars around what is needed (high-resolution timesource, for example) to know what availability there is. |
Wouldn't you expect to see things like #[bench] slow_fn() { /* ... */ }
#[bench] fast_fn() { /* ... */ } And then people would get surprised when |
Yes, sorry I wasn't clear enough. I meant that it's important that the percentages stay the same but the actual times may differ.
Definitely, provided that the |
Just as an idea, profiling might be more stable than running the benchmarks, but provide similar feedback. Assuming execution time and things like cache hits are unstable, the total number of assembly instructions executed for the program is a very useful metric. I am not sure what exactly the backend to this website does, but
|
It would be great to support benchmark tests through the command
cargo bench
available on nightly. Possible use cases include making it easier for others to help optimize code snippets.The text was updated successfully, but these errors were encountered: