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

Negative results for trivial benchmarks #19

Open
jamii opened this issue Aug 26, 2013 · 3 comments
Open

Negative results for trivial benchmarks #19

jamii opened this issue Aug 26, 2013 · 3 comments

Comments

@jamii
Copy link

jamii commented Aug 26, 2013

(with-progress-reporting (bench (let [x nil] (if x true false))))

Warming up for JIT optimisations 10000000000 ...
compilation occured before 2382422 iterations
classes loaded before 69087606 iterations
Estimating execution count ...
Sampling ...
Final GC...
Checking GC...
Finding outliers ...
Bootstrapping ...
Checking outlier significance
Evaluation count : 2439571620 in 60 samples of 40659527 calls.
Execution time mean : -1.293231 ns
Execution time std-deviation : 0.633958 ns
Execution time lower quantile : -2.010323 ns ( 2.5%)
Execution time upper quantile : 0.440421 ns (97.5%)
Overhead used : 26.202637 ns

@hugoduncan
Copy link
Owner

Criterium estimates the function call overhead for wrapping the expression you pass it. The estimate is conservative, but can still be too high by the looks of things.

We should really warn if the measured time is less than some factor of the estimated function call overhead.

@jamii
Copy link
Author

jamii commented Aug 27, 2013

I worked around it by adding (bench (dotimes [_ n] ...)). Would it be reasonable to automatically add that when the estimated time is very low?

@hugoduncan
Copy link
Owner

Sounds like a good idea.

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