diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-01 10:39:12 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-01 10:39:12 +0000 |
commit | f44446c45d8875d5e5d6e556da8d1ff3d4452cab (patch) | |
tree | b9434e53799d5c364bc1b7e6593cece5dd6be294 /benchmark | |
parent | 0fe64693a7d018dde9b9a5d88dd7a9eac60ea14d (diff) |
* benchmark/bm_app_erb.rb: increase loop count. too short
mesurement time makes less accuracy.
* benchmark/bm_app_factorial.rb: ditto.
* benchmark/bm_app_mandelbrot.rb: ditto.
* benchmark/bm_app_strconcat.rb: ditto.
* benchmark/bm_io_file_create.rb: ditto.
* benchmark/bm_io_file_read.rb: ditto.
* benchmark/bm_io_file_write.rb: ditto.
* benchmark/bm_so_concatenate.rb: ditto.
* benchmark/bm_so_lists.rb: ditto.
* benchmark/bm_so_matrix.rb: ditto.
* benchmark/bm_so_random.rb: ditto.
* benchmark/bm_so_sieve.rb: ditto.
* benchmark/bm_vm_thread_mutex1.rb: ditto.
* benchmark/bm_vm_thread_mutex2.rb: ditto.
* benchmark/bm_vm_thread_mutex3.rb: ditto.
* benchmark/bm_vm1_block.rb: cleanup.
* benchmark/bm_vm1_const.rb: cleanup.
* benchmark/bm_vm1_ensure.rb: cleanup.
* benchmark/bm_vm1_ivar.rb: cleanup.
* benchmark/bm_vm1_length.rb: cleanup.
* benchmark/bm_vm1_neq.rb: cleanup.
* benchmark/bm_vm1_not.rb: cleanup.
* benchmark/bm_vm1_rescue.rb: cleanup.
* benchmark/bm_vm1_simplereturn.rb: cleanup.
* benchmark/bm_vm1_swap.rb: cleanup.
* benchmark/bm_vm2_array.rb: cleanup.
* benchmark/bm_vm2_case.rb: cleanup.
* benchmark/bm_vm2_defined_method.rb: cleanup.
* benchmark/bm_vm2_eval.rb: cleanup.
* benchmark/bm_vm2_method.rb: cleanup.
* benchmark/bm_vm2_mutex.rb: cleanup.
* benchmark/bm_vm2_poly_method.rb: cleanup.
* benchmark/bm_vm2_poly_method_ov.rb: cleanup.
* benchmark/bm_vm2_proc.rb: cleanup.
* benchmark/bm_vm2_regexp.rb: cleanup.
* benchmark/bm_vm2_send.rb: cleanup.
* benchmark/bm_vm2_super.rb: cleanup.
* benchmark/bm_vm2_unif1.rb: cleanup.
* benchmark/bm_vm2_zsuper.rb: cleanup.
* benchmark/bm_vm_thread_alive_check1.rb: cleanup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
41 files changed, 44 insertions, 44 deletions
diff --git a/benchmark/bm_app_erb.rb b/benchmark/bm_app_erb.rb index e58b7a34a1..77c66a7949 100644 --- a/benchmark/bm_app_erb.rb +++ b/benchmark/bm_app_erb.rb @@ -5,7 +5,7 @@ require 'erb' data = DATA.read -max = 5_000 +max = 15_000 title = "hello world!" content = "hello world!\n" * 10 diff --git a/benchmark/bm_app_factorial.rb b/benchmark/bm_app_factorial.rb index a5a5de0426..45f471dfdb 100644 --- a/benchmark/bm_app_factorial.rb +++ b/benchmark/bm_app_factorial.rb @@ -6,6 +6,6 @@ def fact(n) end end -8.times{ +100.times { fact(5000) -}
\ No newline at end of file +} diff --git a/benchmark/bm_app_mandelbrot.rb b/benchmark/bm_app_mandelbrot.rb index a0dcf5e874..89069db7ab 100644 --- a/benchmark/bm_app_mandelbrot.rb +++ b/benchmark/bm_app_mandelbrot.rb @@ -12,8 +12,8 @@ end ary = [] -(0..100).each{|dx| - (0..100).each{|dy| +(0..1000).each{|dx| + (0..1000).each{|dy| x = dx / 50.0 y = dy / 50.0 c = Complex(x, y) diff --git a/benchmark/bm_app_strconcat.rb b/benchmark/bm_app_strconcat.rb index c6ef817263..7b2f2da5a7 100644 --- a/benchmark/bm_app_strconcat.rb +++ b/benchmark/bm_app_strconcat.rb @@ -1,5 +1,5 @@ i=0 -while i<500000 +while i<2_000_000 "#{1+1} #{1+1} #{1+1}" i+=1 end diff --git a/benchmark/bm_io_file_create.rb b/benchmark/bm_io_file_create.rb index 7adbe9ea5e..2f205c1333 100644 --- a/benchmark/bm_io_file_create.rb +++ b/benchmark/bm_io_file_create.rb @@ -2,7 +2,7 @@ # Create files # -max = 50_000 +max = 200_000 file = './tmpfile_of_bm_io_file_create' max.times{ diff --git a/benchmark/bm_io_file_read.rb b/benchmark/bm_io_file_read.rb index 2b4212db76..b9e796ed30 100644 --- a/benchmark/bm_io_file_read.rb +++ b/benchmark/bm_io_file_read.rb @@ -4,7 +4,7 @@ require 'tempfile' -max = 20_000 +max = 200_000 str = "Hello world! " * 1000 f = Tempfile.new('yarv-benchmark') f.write str diff --git a/benchmark/bm_io_file_write.rb b/benchmark/bm_io_file_write.rb index 3cec58c6ae..aa1be0e5fe 100644 --- a/benchmark/bm_io_file_write.rb +++ b/benchmark/bm_io_file_write.rb @@ -4,7 +4,7 @@ require 'tempfile' -max = 20_000 +max = 200_000 str = "Hello world! " * 1000 f = Tempfile.new('yarv-benchmark') diff --git a/benchmark/bm_so_concatenate.rb b/benchmark/bm_so_concatenate.rb index 82629688b7..56b9410632 100644 --- a/benchmark/bm_so_concatenate.rb +++ b/benchmark/bm_so_concatenate.rb @@ -9,7 +9,7 @@ i=0 while i<10 i+=1 hello = '' - 400000.times do |e| + 4_000_000.times do |e| hello << STUFF end end diff --git a/benchmark/bm_so_fannkuch.rb b/benchmark/bm_so_fannkuch.rb index a214f2e205..bac5ecd44c 100644 --- a/benchmark/bm_so_fannkuch.rb +++ b/benchmark/bm_so_fannkuch.rb @@ -40,6 +40,6 @@ end def puts *args end -N = 10 # (ARGV[0] || 1).to_i +N = 9 # (ARGV[0] || 1).to_i puts "Pfannkuchen(#{N}) = #{fannkuch(N)}" diff --git a/benchmark/bm_so_lists.rb b/benchmark/bm_so_lists.rb index 3652288881..f8d26797aa 100644 --- a/benchmark/bm_so_lists.rb +++ b/benchmark/bm_so_lists.rb @@ -1,6 +1,6 @@ #from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby -NUM = 100 +NUM = 300 SIZE = 10000 def test_lists() diff --git a/benchmark/bm_so_matrix.rb b/benchmark/bm_so_matrix.rb index 0f274ad06c..e2c5c8e559 100644 --- a/benchmark/bm_so_matrix.rb +++ b/benchmark/bm_so_matrix.rb @@ -5,7 +5,7 @@ n = 60 #Integer(ARGV.shift || 1) -size = 30 +size = 40 def mkmatrix(rows, cols) count = 1 diff --git a/benchmark/bm_so_random.rb b/benchmark/bm_so_random.rb index 83c0d6d380..57f700b863 100644 --- a/benchmark/bm_so_random.rb +++ b/benchmark/bm_so_random.rb @@ -10,7 +10,7 @@ def gen_random(max) (max * ($last = ($last * IA + IC) % IM)) / IM end -N = 1000000 +N = 3_000_000 i=0 while i<N diff --git a/benchmark/bm_so_sieve.rb b/benchmark/bm_so_sieve.rb index dbe2bfa63d..3f1b138bd1 100644 --- a/benchmark/bm_so_sieve.rb +++ b/benchmark/bm_so_sieve.rb @@ -1,5 +1,5 @@ # from http://www.bagley.org/~doug/shootout/bench/sieve/sieve.ruby -num = 40 +num = 500 count = i = j = 0 flags0 = Array.new(8192,1) k = 0 diff --git a/benchmark/bm_vm1_block.rb b/benchmark/bm_vm1_block.rb index 2dc4e72be5..0a97883974 100644 --- a/benchmark/bm_vm1_block.rb +++ b/benchmark/bm_vm1_block.rb @@ -3,8 +3,8 @@ def m end i=0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+=1 m{ } -end
\ No newline at end of file +end diff --git a/benchmark/bm_vm1_const.rb b/benchmark/bm_vm1_const.rb index 3e395d9478..066916dc31 100644 --- a/benchmark/bm_vm1_const.rb +++ b/benchmark/bm_vm1_const.rb @@ -1,7 +1,7 @@ Const = 1 i = 0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+= 1 j = Const k = Const diff --git a/benchmark/bm_vm1_ensure.rb b/benchmark/bm_vm1_ensure.rb index c3b71ead5a..b1948f7621 100644 --- a/benchmark/bm_vm1_ensure.rb +++ b/benchmark/bm_vm1_ensure.rb @@ -1,5 +1,5 @@ i=0 -while i<30000000 # benchmark loop 1 +while i<30_000_000 # benchmark loop 1 i+=1 begin begin diff --git a/benchmark/bm_vm1_ivar.rb b/benchmark/bm_vm1_ivar.rb index 4de833a316..3ba56427f4 100644 --- a/benchmark/bm_vm1_ivar.rb +++ b/benchmark/bm_vm1_ivar.rb @@ -1,7 +1,7 @@ @a = 1 i = 0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+= 1 j = @a k = @a diff --git a/benchmark/bm_vm1_length.rb b/benchmark/bm_vm1_length.rb index 2d7d7f0b52..ccb773278f 100644 --- a/benchmark/bm_vm1_length.rb +++ b/benchmark/bm_vm1_length.rb @@ -1,7 +1,7 @@ a = 'abc' b = [1, 2, 3] i=0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+=1 a.length b.length diff --git a/benchmark/bm_vm1_neq.rb b/benchmark/bm_vm1_neq.rb index 212f056c6e..9254a0ca9b 100644 --- a/benchmark/bm_vm1_neq.rb +++ b/benchmark/bm_vm1_neq.rb @@ -2,7 +2,7 @@ i = 0 obj1 = Object.new obj2 = Object.new -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+= 1 obj1 != obj2 end diff --git a/benchmark/bm_vm1_not.rb b/benchmark/bm_vm1_not.rb index f139fed8be..ee9d0f3605 100644 --- a/benchmark/bm_vm1_not.rb +++ b/benchmark/bm_vm1_not.rb @@ -1,7 +1,7 @@ i = 0 obj = Object.new -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+= 1 !obj end diff --git a/benchmark/bm_vm1_rescue.rb b/benchmark/bm_vm1_rescue.rb index 0c98d00e0d..3af12bb0f3 100644 --- a/benchmark/bm_vm1_rescue.rb +++ b/benchmark/bm_vm1_rescue.rb @@ -1,5 +1,5 @@ i=0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+=1 begin rescue diff --git a/benchmark/bm_vm1_simplereturn.rb b/benchmark/bm_vm1_simplereturn.rb index c843ee3d97..8e9bcb0129 100644 --- a/benchmark/bm_vm1_simplereturn.rb +++ b/benchmark/bm_vm1_simplereturn.rb @@ -2,7 +2,7 @@ def m return 1 end i=0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+=1 m end diff --git a/benchmark/bm_vm1_swap.rb b/benchmark/bm_vm1_swap.rb index a565b6f6dc..611baf6b99 100644 --- a/benchmark/bm_vm1_swap.rb +++ b/benchmark/bm_vm1_swap.rb @@ -1,7 +1,7 @@ a = 1 b = 2 i=0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+=1 a, b = b, a end diff --git a/benchmark/bm_vm2_array.rb b/benchmark/bm_vm2_array.rb index e29c11200f..7713ae9f25 100644 --- a/benchmark/bm_vm2_array.rb +++ b/benchmark/bm_vm2_array.rb @@ -1,5 +1,5 @@ i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 a = [1,2,3,4,5,6,7,8,9,10] end diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb index 1ec34ad692..cd09788a85 100644 --- a/benchmark/bm_vm2_case.rb +++ b/benchmark/bm_vm2_case.rb @@ -1,5 +1,5 @@ i=0 -while i<6000000 # while loop 2 +while i<6_000_000 # while loop 2 case :foo when :bar raise diff --git a/benchmark/bm_vm2_defined_method.rb b/benchmark/bm_vm2_defined_method.rb index a14c43f856..06c0d01baa 100644 --- a/benchmark/bm_vm2_defined_method.rb +++ b/benchmark/bm_vm2_defined_method.rb @@ -3,7 +3,7 @@ class Object end i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 m; m; m; m; m; m; m; m; end diff --git a/benchmark/bm_vm2_eval.rb b/benchmark/bm_vm2_eval.rb index 375dccc00e..e72b4661ac 100644 --- a/benchmark/bm_vm2_eval.rb +++ b/benchmark/bm_vm2_eval.rb @@ -1,5 +1,5 @@ i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 eval("1") end diff --git a/benchmark/bm_vm2_method.rb b/benchmark/bm_vm2_method.rb index cc94b8ab3d..f92e39a73f 100644 --- a/benchmark/bm_vm2_method.rb +++ b/benchmark/bm_vm2_method.rb @@ -3,7 +3,7 @@ def m end i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 m; m; m; m; m; m; m; m; end diff --git a/benchmark/bm_vm2_mutex.rb b/benchmark/bm_vm2_mutex.rb index 9ec1a0f136..01b1c478cb 100644 --- a/benchmark/bm_vm2_mutex.rb +++ b/benchmark/bm_vm2_mutex.rb @@ -3,7 +3,7 @@ require 'thread' m = Mutex.new i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 m.synchronize{} end diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb index ac9953ce5f..921457d817 100644 --- a/benchmark/bm_vm2_poly_method.rb +++ b/benchmark/bm_vm2_poly_method.rb @@ -13,7 +13,7 @@ o1 = C1.new o2 = C2.new i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 o = (i % 2 == 0) ? o1 : o2 o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m i+=1 diff --git a/benchmark/bm_vm2_poly_method_ov.rb b/benchmark/bm_vm2_poly_method_ov.rb index 856ba9b161..bf09837dd7 100644 --- a/benchmark/bm_vm2_poly_method_ov.rb +++ b/benchmark/bm_vm2_poly_method_ov.rb @@ -13,7 +13,7 @@ o1 = C1.new o2 = C2.new i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 o = (i % 2 == 0) ? o1 : o2 # o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m i+=1 diff --git a/benchmark/bm_vm2_proc.rb b/benchmark/bm_vm2_proc.rb index 0bd05b9544..3f51056bf9 100644 --- a/benchmark/bm_vm2_proc.rb +++ b/benchmark/bm_vm2_proc.rb @@ -7,7 +7,7 @@ pr = m{ } i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 pr.call end diff --git a/benchmark/bm_vm2_regexp.rb b/benchmark/bm_vm2_regexp.rb index 44f6ed402e..428099e55a 100644 --- a/benchmark/bm_vm2_regexp.rb +++ b/benchmark/bm_vm2_regexp.rb @@ -1,6 +1,6 @@ i=0 str = 'xxxhogexxx' -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 /hoge/ =~ str i+=1 end diff --git a/benchmark/bm_vm2_send.rb b/benchmark/bm_vm2_send.rb index c20dbdd26c..37c79fb1c3 100644 --- a/benchmark/bm_vm2_send.rb +++ b/benchmark/bm_vm2_send.rb @@ -6,7 +6,7 @@ end o = C.new i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 o.__send__ :m end diff --git a/benchmark/bm_vm2_super.rb b/benchmark/bm_vm2_super.rb index 70c86b376f..d4f0b647de 100644 --- a/benchmark/bm_vm2_super.rb +++ b/benchmark/bm_vm2_super.rb @@ -14,7 +14,7 @@ end obj = CC.new i = 0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 obj.m i+=1 end diff --git a/benchmark/bm_vm2_unif1.rb b/benchmark/bm_vm2_unif1.rb index e12bd2ade0..775f4d37e6 100644 --- a/benchmark/bm_vm2_unif1.rb +++ b/benchmark/bm_vm2_unif1.rb @@ -2,7 +2,7 @@ i = 0 def m a, b end -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 m 100, 200 end diff --git a/benchmark/bm_vm2_zsuper.rb b/benchmark/bm_vm2_zsuper.rb index 3a75960403..7e90df1822 100644 --- a/benchmark/bm_vm2_zsuper.rb +++ b/benchmark/bm_vm2_zsuper.rb @@ -14,7 +14,7 @@ end obj = CC.new -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 obj.m 10 i+=1 end diff --git a/benchmark/bm_vm_thread_alive_check1.rb b/benchmark/bm_vm_thread_alive_check1.rb index aebe99875d..c993accdda 100644 --- a/benchmark/bm_vm_thread_alive_check1.rb +++ b/benchmark/bm_vm_thread_alive_check1.rb @@ -1,4 +1,4 @@ -5000.times{ +5_000.times{ t = Thread.new{} while t.alive? Thread.pass diff --git a/benchmark/bm_vm_thread_mutex1.rb b/benchmark/bm_vm_thread_mutex1.rb index faf8da122f..588506e87c 100644 --- a/benchmark/bm_vm_thread_mutex1.rb +++ b/benchmark/bm_vm_thread_mutex1.rb @@ -3,7 +3,7 @@ require 'thread' m = Mutex.new r = 0 -max = 1000 +max = 2000 lmax = max * max (1..1).map{ Thread.new{ diff --git a/benchmark/bm_vm_thread_mutex2.rb b/benchmark/bm_vm_thread_mutex2.rb index a74e2fd490..d700b146d4 100644 --- a/benchmark/bm_vm_thread_mutex2.rb +++ b/benchmark/bm_vm_thread_mutex2.rb @@ -3,7 +3,7 @@ require 'thread' m = Mutex.new r = 0 -max = 1000 +max = 2000 lmax = (max * max)/2 (1..2).map{ Thread.new{ diff --git a/benchmark/bm_vm_thread_mutex3.rb b/benchmark/bm_vm_thread_mutex3.rb index ae02e20ea0..f502b6ac84 100644 --- a/benchmark/bm_vm_thread_mutex3.rb +++ b/benchmark/bm_vm_thread_mutex3.rb @@ -3,7 +3,7 @@ require 'thread' m = Mutex.new r = 0 -max = 1000 +max = 2000 (1..max).map{ Thread.new{ i=0 |