GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Prettier Benchmarking for Ruby
Clone URL: git://github.com/wycats/benchwarmer.git
Fixes cases with anonymous groups and anonymous runs. TODO: Add support 
for aggregating the results of multiple runs
wycats (author)
Sat May 03 16:31:20 -0700 2008
commit  b4465784e9f6b828fa48f1fb94a685b3c1c661b0
tree    4f435cec8228456e7486940c1ec7abf5a501ccb0
parent  3d36da3b0fa22f3a4183da7e4403f1850fb76f7a
...
84
85
86
 
87
88
89
...
95
96
97
98
 
99
100
 
101
102
103
104
 
105
106
107
...
84
85
86
87
88
89
90
...
96
97
98
 
99
100
 
101
102
103
104
 
105
106
107
108
0
@@ -84,6 +84,7 @@ module Benchmark
0
     end
0
     
0
     def titles(titles)
0
+ @columns ||= Dictionary.new
0
       @columns.merge!(titles)
0
     end
0
     
0
@@ -95,13 +96,13 @@ module Benchmark
0
     end
0
     
0
     def report(str, &blk)
0
- @groups ||= Dictionary.new
0
+ @groups ||= Dictionary.new {|h,k| h[k] = Dictionary.new}
0
       if !@columns || @columns.size == 1
0
- @groups[@current_group || "default"][str] = [blk]
0
+ @groups[@current_group || ""][str] = [blk]
0
       else
0
         report = GroupReport.new(@columns.keys)
0
         report.instance_eval(&blk)
0
- @groups[@current_group || "default"][str] = report.runs
0
+ @groups[@current_group || ""][str] = report.runs
0
       end
0
     end
0
     

Comments

    No one has commented yet.