BenchmarkTools.jl
BenchmarkTools.jl copied to clipboard
Replace markdown manual/reference documentation with actual docstrings + Documenter.jl
Good documentation for btime:
help?> @btime
@btime expression [other parameters...]
Similar to the @time macro included with Julia, this executes an expression, printing the time it
took to execute and the memory allocated before returning the value of the expression.
Unlike @time, it uses the @benchmark macro, and accepts all of the same additional parameters as
@benchmark. The printed time is the minimum elapsed time measured during the benchmark.
But bad documentation for the cross-referenced @benchmark
:
help?> @benchmark
No documentation found.
BenchmarkTools.@benchmark is a macro.
# 1 method for macro "@benchmark":
[1] @benchmark(__source__::LineNumberNode, __module__::Module, args...) in BenchmarkTools at C:\Users\Andrew Fitzgibbon\.julia\packages\BenchmarkTools\mVOqg\src\execution.jl:209
I had to trace through the code to find
mutable struct Parameters
seconds::Float64
samples::Int
evals::Int
overhead::Float64
gctrial::Bool
gcsample::Bool
time_tolerance::Float64
memory_tolerance::Float64
end
And then guess from there.
I realize it may not be easy to autogenerate, but either way, help on @benchmark
should do something useful.
They're documented in the BenchmarkTools manual.
We should definitely update BenchmarkTools to use normal docstrings, Documenter.jl, etc.
Thanks. In the short run, even a hyperlink to the manual would be considerably more ergonomic.