add benchmark suite

This commit is contained in:
Watson
2013-11-16 09:16:58 +09:00
parent d594397510
commit a749bfc648
25 changed files with 1074 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
def array_sort(x)
array = $small_fixnum_array.dup
x.report "sort" do
10000.times do |i|
array.sort
end
end
x.report "sort with block" do
1000.times do |i|
array.sort {|a, b| b <=> a }
end
end
x.report "sort!" do
10000.times do |i|
array = $small_fixnum_array.dup
array.sort!
end
end
x.report "sort! with block" do
1000.times do |i|
array = $small_fixnum_array.dup
array.sort! {|a, b| b <=> a }
end
end
end