File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -154,11 +154,15 @@ def compute_bench_names
154154
155155 # Sort benchmarks with headlines first, then others, then micro
156156 def sort_benchmarks ( bench_names , metadata )
157- headline_benchmarks = metadata . select { |_ , meta | meta [ 'category' ] == 'headline' } . keys
158- micro_benchmarks = metadata . select { | _ , meta | meta [ 'category' ] == 'micro' } . keys
157+ bench_names . sort_by { |name | [ category_priority ( name , metadata ) , name ] }
158+ end
159159
160- headline_names , bench_names = bench_names . partition { |name | headline_benchmarks . include? ( name ) }
161- micro_names , other_names = bench_names . partition { |name | micro_benchmarks . include? ( name ) }
162- headline_names . sort + other_names . sort + micro_names . sort
160+ def category_priority ( bench_name , metadata )
161+ category = metadata . dig ( bench_name , 'category' ) || 'other'
162+ case category
163+ when 'headline' then 0
164+ when 'micro' then 2
165+ else 1
166+ end
163167 end
164168end
You can’t perform that action at this time.
0 commit comments