-
Notifications
You must be signed in to change notification settings - Fork 33
[WIP/RFC] Start benchmarking #69
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using BenchmarkTools | ||
using FixedPointNumbers | ||
import JLD | ||
|
||
suite = BenchmarkGroup() | ||
suite["conversion"] = BenchmarkGroup() | ||
|
||
for FT in (Q0f7, Q1f14, Q7f24, N0f8, N2f14, N0f32, N2f30, N0f64, N2f62) | ||
x = FT(0.25) | ||
# Float16 doesn't behave well | ||
for T in (Float32, Float64, BigFloat) | ||
y = convert(T, x) | ||
suite["conversion"]["$FT-to-$T"] = @benchmarkable convert($T, $x) | ||
suite["conversion"]["$T-to-$FT"] = @benchmarkable convert($FT, $y) | ||
end | ||
end | ||
|
||
# Load the suite's cached parameters as part of including the file. This is much | ||
# faster and more reliable than re-tuning `suite` every time the file is included | ||
paramspath = Pkg.dir("FixedPointNumbers", "benchmark", "params.jld") | ||
# tune!(suite); JLD.save(paramspath, "suite", params(suite)); | ||
loadparams!(suite, JLD.load(paramspath, "suite"), :evals, :samples); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably check to see if the parameters have been generated locally, and if not, generate them. You don't want to check in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, I do realize this comes from BenchmarkTools example, so I should probably update that to reflect what I'm actually saying here... |
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think only on julia 0.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah... We (I) did change those semantics on v0.6