Mercurial > repos > public > sbplib_julia
annotate benchmark/benchmarks.jl @ 1172:34446df5733f tooling/benchmarks
Add run_and_view script
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 25 Jan 2023 12:52:09 +0100 |
parents | 87bc91def1ff |
children | 50c31500eb97 |
rev | line source |
---|---|
1171 | 1 using BenchmarkTools |
2 using Random | |
3 | |
4 const SUITE = BenchmarkGroup() | |
5 | |
6 SUITE["utf8"] = BenchmarkGroup(["string", "unicode"]) | |
7 teststr = String(join(rand(MersenneTwister(1), 'a':'d', 10^4))) | |
8 SUITE["utf8"]["replace"] = @benchmarkable replace($teststr, "a" => "b") | |
9 SUITE["utf8"]["join"] = @benchmarkable join($teststr, $teststr) | |
10 SUITE["utf8"]["plots"] = BenchmarkGroup() | |
11 | |
12 SUITE["trigonometry"] = BenchmarkGroup(["math", "triangles"]) | |
13 SUITE["trigonometry"]["circular"] = BenchmarkGroup() | |
14 for f in (sin, cos, tan) | |
15 for x in (0.0, pi) | |
16 SUITE["trigonometry"]["circular"][string(f), x] = @benchmarkable ($f)($x) | |
17 end | |
18 end | |
19 | |
20 SUITE["trigonometry"]["hyperbolic"] = BenchmarkGroup() | |
21 for f in (sin, cos, tan) | |
22 for x in (0.0, pi) | |
23 SUITE["trigonometry"]["hyperbolic"][string(f), x] = @benchmarkable ($f)($x) | |
24 end | |
25 end | |
26 | |
27 SUITE | |
28 | |
1172
34446df5733f
Add run_and_view script
Jonatan Werpers <jonatan@werpers.com>
parents:
1171
diff
changeset
|
29 # TODO: Add mercurial version of benchmarkpkg |
1171 | 30 # TODO: Make it easy to compare different commits. (A simple script?) |
31 | |
32 # Should set HGPLAIN before script use. Example: `HGPLAIN= hg st` |