-
Notifications
You must be signed in to change notification settings - Fork 177
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: enhanced benchmark discovery #481
Comments
This version is less optimized than the previous, but more readable and will help to implement custom named benchmarks. Related to airspeed-velocity#481
* move benchmark discovery and instanciation related code in disc_benchmark() * rename from_name() to get_benchmark_from_name() outside of Benchmark class * use disc_benchmark() in get_benchmark_from_name(), less optimized version but more readable and no more rely on benchmark name. Related to airspeed-velocity#481
This allow to control the full name of a benchmark function Closes airspeed-velocity#481
This allow to control the full name of a benchmark function Related to airspeed-velocity#481
This allow to control the full name of a benchmark function Related to airspeed-velocity#481
This allow to control the full name of a benchmark function Related to airspeed-velocity#481
I would like to keep it simple here, and not offer customization options on the benchmark discovery, unless the use cases are clearly necessary. I think it's fine for asv to have an opinion on how benchmark suites should be structured. A I think at least Nose had a feature like this. I don't recall exactly how pytest handles this. |
* move benchmark discovery and instanciation related code in disc_benchmark() * rename from_name() to get_benchmark_from_name() outside of Benchmark class * use disc_benchmark() in get_benchmark_from_name(), less optimized version but more readable and no more rely on benchmark name. Related to airspeed-velocity#481
This allow to control the full name of a benchmark function Related to airspeed-velocity#481
This allow to control the full name of a benchmark function Related to airspeed-velocity#481
This allow to control the full name of a benchmark function Related to airspeed-velocity#481
It would be great if asv could rely on pytest to perform benchmark discovery/collection, as this would e.g. also allow using pytest parametrization and fixtures, as pytest-benchmark (http://pytest-benchmark.readthedocs.io/en/stable/usage.html) does. See e.g. https://github.com/anntzer/mpl_cairo/blob/master/tests/test_speed.py for a case where parametrization makes sense. (While I think pytest-benchmark is much better at benchmark collection, its reporting/postprocessing facilities are nowhere as good as asv's). |
Current situation, in case someone stumbles upon here: https://asv.readthedocs.io/en/stable/benchmarks.html#general pytest-benchmark integration is #567, I'm not planning to work on implementing/maintaining it however at the moment, and whether its runtime model is compatible is unclear. |
Currently benchmark discovery (and categorization in web ui) is done by introspecting python files in
benchmark_dir
and looking for__name__
of functions and classes and module name relative tobenchmark_dir
.This make hard to generate benchmark function programmatically because we have to take care of
__name__
and create a module for each category and separate the entire benchmark code in a specific directory. Also changing the function name or moving it to another module requires to update all benchmark results.I wonder if we could use the same logic than https://github.com/celery/celery for discovering tasks eg:
benchmark_load
config could be a list of importables modules<import_name_relative_to_pythonpath>.module.Class.function
name
attribute on the function).What do you think ?
After reviewing my list, I think just adding named benchmark is a good start (and backward compatible), I try to write a PR for this.
The text was updated successfully, but these errors were encountered: