@@ -264,7 +264,7 @@ julia> x = rand(100000);
264
264
# For each sample, bind a variable `y` to a fresh copy of `x`. As you
265
265
# can see, `y` is accessible within the scope of the core expression.
266
266
julia> b = @benchmarkable sort! (y) setup= (y = copy ($ x))
267
- BenchmarkTools . Benchmark {symbol("##benchmark#7556")} (BenchmarkTools . Parameters ( 5.0 , 1000 , 1 , true , false , 0.05 , 0.05 ) )
267
+ Benchmark (evals = 1 , seconds = 5.0 , samples = 10000 )
268
268
269
269
julia> run (b)
270
270
BenchmarkTools. Trial:
@@ -544,45 +544,39 @@ suite = BenchmarkGroup()
544
544
# for this case is BenchmarkGroup(tags::Vector). These tags are useful for
545
545
# filtering benchmarks by topic, which we'll cover in a later section.
546
546
suite[" utf8" ] = BenchmarkGroup ([" string" , " unicode" ])
547
- suite[" trigonometry " ] = BenchmarkGroup ([" math" , " triangles" ])
547
+ suite[" trig " ] = BenchmarkGroup ([" math" , " triangles" ])
548
548
549
549
# Add some benchmarks to the "utf8" group
550
- teststr = UTF8String ( join (rand (MersenneTwister (1 ), ' a' :' d' , 10 ^ 4 ) ))
550
+ teststr = join (rand (MersenneTwister (1 ), ' a' :' d' , 10 ^ 4 ))
551
551
suite[" utf8" ][" replace" ] = @benchmarkable replace ($ teststr, " a" , " b" )
552
552
suite[" utf8" ][" join" ] = @benchmarkable join ($ teststr, $ teststr)
553
553
554
554
# Add some benchmarks to the "trigonometry" group
555
555
for f in (sin, cos, tan)
556
556
for x in (0.0 , pi )
557
- suite[" trigonometry " ][string (f), x] = @benchmarkable $ (f)($ x)
557
+ suite[" trig " ][string (f), x] = @benchmarkable $ (f)($ x)
558
558
end
559
559
end
560
560
```
561
561
562
562
Let's look at our newly defined suite in the REPL:
563
563
564
564
``` julia
565
- julia> suite
566
- BenchmarkTools. BenchmarkGroup:
565
+ julia> showall ( suite)
566
+ 2 - element BenchmarkTools. BenchmarkGroup:
567
567
tags: []
568
- " utf8" => BenchmarkGroup ([" string" , " unicode" ])
569
- " trigonometry" => BenchmarkGroup ([" math" , " triangles" ])
570
-
571
- julia> suite[" utf8" ]
572
- BenchmarkTools. BenchmarkGroup:
573
- tags: [" string" , " unicode" ]
574
- " join" => BenchmarkTools. Benchmark {symbol("##benchmark#7184")} (... )
575
- " replace" => BenchmarkTools. Benchmark {symbol("##benchmark#7165")} (... )
576
-
577
- julia> suite[" trigonometry" ]
578
- BenchmarkTools. BenchmarkGroup:
579
- tags: [" math" , " triangles" ]
580
- (" tan" ,π = 3.1415926535897 ... ) => BenchmarkTools. Benchmark {symbol("##benchmark#7233")} (... )
581
- (" cos" ,0.0 ) => BenchmarkTools. Benchmark {symbol("##benchmark#7218")} (... )
582
- (" cos" ,π = 3.1415926535897 ... ) => BenchmarkTools. Benchmark {symbol("##benchmark#7223")} (... )
583
- (" sin" ,π = 3.1415926535897 ... ) => BenchmarkTools. Benchmark {symbol("##benchmark#7209")} (... )
584
- (" sin" ,0.0 ) => BenchmarkTools. Benchmark {symbol("##benchmark#7201")} (... )
585
- (" tan" ,0.0 ) => BenchmarkTools. Benchmark {symbol("##benchmark#7228")} (... )
568
+ " utf8" => 2 - element BenchmarkTools. BenchmarkGroup:
569
+ tags: [" string" , " unicode" ]
570
+ " join" => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
571
+ " replace" => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
572
+ " trig" => 6 - element BenchmarkTools. BenchmarkGroup:
573
+ tags: [" math" , " triangles" ]
574
+ (" cos" , 0.0 ) => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
575
+ (" sin" , π = 3.1415926535897 ... ) => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
576
+ (" tan" , π = 3.1415926535897 ... ) => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
577
+ (" cos" , π = 3.1415926535897 ... ) => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
578
+ (" sin" , 0.0 ) => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
579
+ (" tan" , 0.0 ) => Benchmark (evals= 1 , seconds= 5.0 , samples= 10000 )
586
580
```
587
581
588
582
As you might imagine, ` BenchmarkGroup ` supports a subset of Julia's ` Associative ` interface. A full list of
0 commit comments