cargo-criterion
cargo-criterion copied to clipboard
FR: Support constant/user-supplied data
Thanks for your work on this tool!
I'd like to be able to draw an extra line on the plots generated by cargo criterion
. A couple use cases I can imagine:
-
I know some theoretical maximum performance that I'm trying to get close to (why I bring it up). For example, my function processes something at X bytes/s, and my CPU is capable of Y bytes/s. I'd like to get a sense in the combined plots of how close I am.
For this, I'd just like to provide a single throughput rate and have a straight line drawn on a (hypothetical) throughput plot.
-
I have some objective I'm trying to hit (timeout, etc.).
This would be a horizontal line on a benchmark; again, I'd like to just provide a number.
Vaguely related to #9, #10.
Potential workarounds:
- Add a "comparison function"
sleep
s for the appropriate time. I tried this and it's really noisy (not shocking). - Hand-generate the data and sticking it in the appropriate location in
target/criterion
. I'm thinking about doing this.