-
Notifications
You must be signed in to change notification settings - Fork 102
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
added btime and belapsed macros, fixed prettymemory to use SI units #37
Conversation
Test failure in 0.6 is due to #38. |
iters = 2 | ||
while (time() - start_time) < params.seconds && iters ≤ params.samples | ||
params.gcsample && BenchmarkTools.gcscrub() | ||
params.gcsample && BenchmarkTools.gcscrub() |
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.
Why is this getting done twice 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.
Typo, sorry
Yay, tests are passing in the rebased branch. |
Rebased. |
Thanks! |
See also JuliaLang/julia#20173 |
|
@@ -1,3 +1,3 @@ | |||
julia 0.4 | |||
Compat 0.8.0 | |||
Compat 0.9.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.
what is this using from 0.9.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.
I can't remember, maybe it was the Symbol
constructor? I definitely upgraded the Compat requirement for a reason.
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.
Symbol
is older I believe - probably JuliaLang/Compat.jl@2c11855
Maybe an earlier version of this was using one of the show rewrites? doesn't look like the final version is though
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 maybe an earlier version tried to use a buffer and String(take!(buf))
for the @btime
test, which requires Compat 0.9.5. I then rewrote it to use redirect_stdout(f)
with a temporary file, which requires Compat 0.9.0 (JuliaLang/Compat.jl@2c11855)
This PR adds two macros,
@btime
and@belapsed
, that are drop-in replacements for@time
and@elapsed
from Base except that they use the@benchmark
apparatus. For example:It also changes the memory output to use SI prefixes. Previously, it would output something like
17.34 kb
, which is ambiguous — is a kb 1000 or 1024 bytes (we use 1024)? TheSIISQ prefix is "KiB" for kibibyte, which unambiguously means 1024 bytes.Also, it now prints
24 bytes
and not24.00 bytes
— the decimal point was confusing since (presumably) we will never be able to allocate a fractional number of bytes.Closes #35.