-
Notifications
You must be signed in to change notification settings - Fork 180
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
RFC: benchmark decorator #482
Comments
I agree that a decorator is a nicer way to do it, and I think larger benchmark suites likely end up writing such a decorator themselves. I think a problem (or inelegancy) here is in exposing the |
Maybe a recipe for such a decorator could simply be added to the ASV docs? I'd be happy to copy it into my project, but it would be nice not to have to think too hard about the design :). I suppose the canonical implementation is something like:
(only 5 lines, not 6!) |
Looking at http://asv.readthedocs.io/en/latest/writing_benchmarks.html, I've just come across the same idea. Sticking to method names is not quite Pythonic and, potentially, error-prone. 👍 |
Closing as completed in airspeed-velocity/asv_runner#18 (and discussed a bit more in #1266). |
I think it could be more pythonic to handle benchmark attributes (params, setup etc) through a single decorator, this way it's more explicit to understand that arguments are injected in the function.
eg:
But I guess we don't have asv installed in the virtualenv used during benchmark and injecting the decorator while loading the module isn't explicit too.
The text was updated successfully, but these errors were encountered: