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

Control number of iterations #9

Open
pelegm opened this issue Nov 10, 2014 · 2 comments
Open

Control number of iterations #9

pelegm opened this issue Nov 10, 2014 · 2 comments

Comments

@pelegm
Copy link

pelegm commented Nov 10, 2014

How many iterations are done by default in benchmarking? I ask this because adding @bench(...) to one of my tests has increased its total duration from about 1.34s to about 120s, but the mean running time was only 3.6us...

Is it possible to add a command-line argument, or a decorator argument, that will control the number of iterations done for benchmarking?

@mehcode
Copy link
Contributor

mehcode commented Nov 11, 2014

You should be able to do:

@pytest.mark.bench('method', iterations=10)

@pelegm
Copy link
Author

pelegm commented Nov 11, 2014

Thanks! For those who have not looked into the code, the default number of iterations is 100.

So: one questions is left: how is it that even when I put iterations=1, I get the line

tests/test_real.py: test_real_binomial ... 1.91           3.10           2.86       1.08

in which the min and the mean are different?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants