-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Adding unrelated code affects benchmark #36
Comments
Is the increase of 100µs consistent across multiple Also, I noticed the spike of downloads yesterday and found your AoC video. Thanks for trying it out! Currently in the growing pains phase. 😄 |
The increase is consistent but I wasn't tracking the exact amount closely enough to say whether it was (for example) 100µs vs 130µs and such. It was not wildly fluctuating. At the very least I ran it multiple times in each configuration, in a row, one after the other, etc, etc. and the results seemed very consistent to me over many runs.
oh fun! glad I could point some people in your direction. |
This might be a bit of work on your end, but could you please check if the same happens with Criterion? |
I've encountered a similar experience and have provided a reproduction here with both I've had some other users clone that and observe the same. My reproduction is fairly simple, just copying a function that isn't used at all introduces a consistent overhead in timings measured on the actual benched function. I suspect it's due to compiler optimizations like this Criterion FAQ entry explains. The reproduction I've linked identifies several changes that can be made to avoid the regression, so this sort of issue is unlikely anything to do with Divan (Criterion measures the same increase in timing). |
I've confirmed that the behavior does exist in divan and criterion. It is only for this one benchmark ( The relevant commit is: https://github.com/ChristopherBiscardi/advent-of-code/tree/26ae09c876602e405dc7943ef61764afd70d8838 Runs without part2_subjectrun 1
run 2
run 3
with part2_subject modulerun 1 (immediately after the above runs)
run 2
run 3
|
Heya! I've been doing advent-of-code and trying out Divan while doing so. Someone showed me some code and I added it to my project to benchmark. Simply adding the code to lib.rs caused one of my benchmarks to rise by 100 microseconds. Commenting or uncommenting this one line (which is not used in the benchmark) in
lib.rs
causes thepart2_nom
benchmark to inflate or deflate accordingly.I've pared the example down as much as I could at the moment. I can try to make a smaller one if I have more time.
https://github.com/ChristopherBiscardi/advent-of-code/tree/divan-benchmark-inflation
This should be enough to run the benchmarks:
benchmarks with subject module
benchmarks without subject module
Here's each run side-by-side for ease of viewing
The text was updated successfully, but these errors were encountered: