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

Support variant metrics - MB/s, items/s, etc #84

Closed
RAOF opened this issue Dec 2, 2017 · 3 comments
Closed

Support variant metrics - MB/s, items/s, etc #84

RAOF opened this issue Dec 2, 2017 · 3 comments

Comments

@RAOF
Copy link

RAOF commented Dec 2, 2017

There are a lot of algorithms for which seconds/iteration can be easily transformed into a more useful metric.

For example, I'm writing a delta-compressor, and so MB/sec would be a more graspable metric.

API-wise, it seems that this could be done by adding a mapping function to the Criterion pipeline. Something like:

Criterion::default()
    .with_metric(|time, test_data| { test_data.len() / time })
    .bench_function_over_inputs(|b, data| {...});
@bheisler
Copy link
Owner

bheisler commented Dec 2, 2017

Hey! Thanks for the suggestion.

I probably won't get around to adding this right away, but I agree that these are useful metrics to have, and this is a use case I'd like to support eventually. I think it would take some internal refactoring work before something like this could be easily added, though.

@Eh2406
Copy link
Contributor

Eh2406 commented Dec 3, 2017

This may be a separate thought... but I have an algorithm the Should be O(n^2). I could use the transform to test that more directly!

@RAOF
Copy link
Author

RAOF commented Dec 3, 2017 via email

@bheisler bheisler mentioned this issue Jan 13, 2018
@bheisler bheisler added this to the Release 0.2.0 milestone Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants