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

Does each Sample in a Benchmark have the same number of evals? #103

Closed
gdalle opened this issue May 14, 2024 · 2 comments
Closed

Does each Sample in a Benchmark have the same number of evals? #103

gdalle opened this issue May 14, 2024 · 2 comments
Labels
question Further information is requested

Comments

@gdalle
Copy link

gdalle commented May 14, 2024

It would seem natural but since each Sample carries its own evals field I wanted to double-check

@LilithHafner LilithHafner added the question Further information is requested label May 14, 2024
@LilithHafner
Copy link
Owner

Yes, that is the case, at least for now. I don't want to guarantee it because we might want to add a more adaptive evals selection method. There is a special case in the display logic to alert you if a benchmark has variable sample count:

julia> bench = @be 1+1
Benchmark: 5636 samples with 13167 evaluations
min    1.136 ns
median 1.206 ns
mean   1.205 ns
max    3.709 ns

julia> only(unique([s.evals for s in bench.samples]))
13167.0

julia> samp = @b rand sqrt
1.981 ns

julia> bench.samples[1] = samp # This is a strange thing to do...
1.981 ns

julia> bench
Benchmark: 5636 samples with variable evaluations
min    1.136 ns
median 1.206 ns
mean   1.205 ns
max    3.709 ns

@gdalle
Copy link
Author

gdalle commented May 14, 2024

Good to know, thanks!
For context, I use Chairmarks within DifferentiationInterfaceTest, and to work around the current absence of ChairmarkGroup I defined an ad-hoc type for results, which I finally got around to document
https://gdalle.github.io/DifferentiationInterface.jl/DifferentiationInterfaceTest/dev/api/#DifferentiationInterfaceTest.DifferentiationBenchmarkDataRow

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

No branches or pull requests

2 participants