Skip to content

Commit efbda98

Browse files
committed
docs
1 parent 182b09e commit efbda98

File tree

2 files changed

+166
-168
lines changed

2 files changed

+166
-168
lines changed

docs/src/index.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ julia> using BenchmarkTools
1717
# timing results. Note that each sample can require multiple evaluations
1818
# benchmark kernel evaluations. See the BenchmarkTools manual for details.
1919
julia> @benchmark sort(data) setup=(data=rand(10))
20-
BenchmarkTools.Trial:
21-
10000 samples with 968 evaulations took a median time of 90.902 ns (0.00% GC)
22-
Time (mean ± σ): 94.936 ns ± 47.797 ns (GC: 2.78% ± 5.03%)
23-
Range (min max): 77.655 ns 954.823 ns (GC: 0.00% 87.94%)
24-
25-
▁▃▅▆▇█▇▆▅▂▁
26-
▂▂▃▃▄▅▆▇███████████▇▆▄▄▃▃▂▂▂▂▂▂▂▂▂▂▂▁▂▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂
27-
77.7 ns Histogram: frequency by time 137 ns
28-
29-
Memory estimate: 160 bytes, allocs estimate: 1.
20+
┌ Trial:
21+
│ min 46.954 ns, median 59.475 ns, mean 61.344 ns, 99ᵗʰ 80.203 ns
22+
1 allocation, 144 bytes
23+
│ GC time: mean 1.092 ns (1.78%), max 537.224 ns (88.05%)
24+
│ ◔ ◑ *
25+
│ ▂▄▅▇▇█▆▆▄▂
26+
│ ▁▂▁▁▂▂▂▂▁▂▂▁▁▂▂▂▂▃▃▅▆████████████▇▅▅▃▃▃▃▃▃▃▃▃▃▃▃▂▃▂▂▂▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▁ ▄
27+
46 ns 10_000 samples, each 985 evaluations 81 ns +
3028
```
3129

30+
In the histogram of sample times, the median is marked `` and the mean `*`; on most displays
31+
these will be indicaded by color too (but not in the documentation).
32+
3233
For quick sanity checks, one can use the [`@btime` macro](https://juliaci.github.io/BenchmarkTools.jl/stable/manual/#Benchmarking-basics), which is a convenience wrapper around `@benchmark` whose output is analogous to Julia's built-in [`@time` macro](https://docs.julialang.org/en/v1/base/base/#Base.@time):
34+
This prints only the **minimum** time, which is often the most informative for fast-running
35+
calculations:
3336

3437
```julia
3538
julia> @btime sin(x) setup=(x=rand())

0 commit comments

Comments
 (0)