ruby-changes:20308
From: kosaki <ko1@a...>
Date: Fri, 1 Jul 2011 19:39:48 +0900 (JST)
Subject: [ruby-changes:20308] kosaki:r32356 (trunk): * benchmark/bm_app_erb.rb: increase loop count. too short
kosaki 2011-07-01 19:39:12 +0900 (Fri, 01 Jul 2011) New Revision: 32356 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32356 Log: * 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. Modified files: trunk/ChangeLog trunk/benchmark/bm_app_erb.rb trunk/benchmark/bm_app_factorial.rb trunk/benchmark/bm_app_mandelbrot.rb trunk/benchmark/bm_app_strconcat.rb trunk/benchmark/bm_io_file_create.rb trunk/benchmark/bm_io_file_read.rb trunk/benchmark/bm_io_file_write.rb trunk/benchmark/bm_so_concatenate.rb trunk/benchmark/bm_so_fannkuch.rb trunk/benchmark/bm_so_lists.rb trunk/benchmark/bm_so_matrix.rb trunk/benchmark/bm_so_random.rb trunk/benchmark/bm_so_sieve.rb trunk/benchmark/bm_vm1_block.rb trunk/benchmark/bm_vm1_const.rb trunk/benchmark/bm_vm1_ensure.rb trunk/benchmark/bm_vm1_ivar.rb trunk/benchmark/bm_vm1_length.rb trunk/benchmark/bm_vm1_neq.rb trunk/benchmark/bm_vm1_not.rb trunk/benchmark/bm_vm1_rescue.rb trunk/benchmark/bm_vm1_simplereturn.rb trunk/benchmark/bm_vm1_swap.rb trunk/benchmark/bm_vm2_array.rb trunk/benchmark/bm_vm2_case.rb trunk/benchmark/bm_vm2_defined_method.rb trunk/benchmark/bm_vm2_eval.rb trunk/benchmark/bm_vm2_method.rb trunk/benchmark/bm_vm2_mutex.rb trunk/benchmark/bm_vm2_poly_method.rb trunk/benchmark/bm_vm2_poly_method_ov.rb trunk/benchmark/bm_vm2_proc.rb trunk/benchmark/bm_vm2_regexp.rb trunk/benchmark/bm_vm2_send.rb trunk/benchmark/bm_vm2_super.rb trunk/benchmark/bm_vm2_unif1.rb trunk/benchmark/bm_vm2_zsuper.rb trunk/benchmark/bm_vm_thread_alive_check1.rb trunk/benchmark/bm_vm_thread_mutex1.rb trunk/benchmark/bm_vm_thread_mutex2.rb trunk/benchmark/bm_vm_thread_mutex3.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 32355) +++ ChangeLog (revision 32356) @@ -1,3 +1,53 @@ +Fri Jul 1 18:52:31 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * 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. + Fri Jul 1 15:23:00 2011 Marc-Andre Lafortune <ruby-core@m...> * lib/matrix: Add LUP decomposition Index: benchmark/bm_io_file_read.rb =================================================================== --- benchmark/bm_io_file_read.rb (revision 32355) +++ benchmark/bm_io_file_read.rb (revision 32356) @@ -4,7 +4,7 @@ require 'tempfile' -max = 20_000 +max = 200_000 str = "Hello world! " * 1000 f = Tempfile.new('yarv-benchmark') f.write str Index: benchmark/bm_vm1_length.rb =================================================================== --- benchmark/bm_vm1_length.rb (revision 32355) +++ benchmark/bm_vm1_length.rb (revision 32356) @@ -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 Index: benchmark/bm_vm2_unif1.rb =================================================================== --- benchmark/bm_vm2_unif1.rb (revision 32355) +++ benchmark/bm_vm2_unif1.rb (revision 32356) @@ -2,7 +2,7 @@ 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 Index: benchmark/bm_vm_thread_alive_check1.rb =================================================================== --- benchmark/bm_vm_thread_alive_check1.rb (revision 32355) +++ benchmark/bm_vm_thread_alive_check1.rb (revision 32356) @@ -1,4 +1,4 @@ -5000.times{ +5_000.times{ t = Thread.new{} while t.alive? Thread.pass Index: benchmark/bm_vm2_poly_method_ov.rb =================================================================== --- benchmark/bm_vm2_poly_method_ov.rb (revision 32355) +++ benchmark/bm_vm2_poly_method_ov.rb (revision 32356) @@ -13,7 +13,7 @@ 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 Index: benchmark/bm_vm2_send.rb =================================================================== --- benchmark/bm_vm2_send.rb (revision 32355) +++ benchmark/bm_vm2_send.rb (revision 32356) @@ -6,7 +6,7 @@ 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 Index: benchmark/bm_vm_thread_mutex3.rb =================================================================== --- benchmark/bm_vm_thread_mutex3.rb (revision 32355) +++ benchmark/bm_vm_thread_mutex3.rb (revision 32356) @@ -3,7 +3,7 @@ require 'thread' m = Mutex.new r = 0 -max = 1000 +max = 2000 (1..max).map{ Thread.new{ i=0 Index: benchmark/bm_io_file_write.rb =================================================================== --- benchmark/bm_io_file_write.rb (revision 32355) +++ benchmark/bm_io_file_write.rb (revision 32356) @@ -4,7 +4,7 @@ require 'tempfile' -max = 20_000 +max = 200_000 str = "Hello world! " * 1000 f = Tempfile.new('yarv-benchmark') Index: benchmark/bm_vm2_super.rb =================================================================== --- benchmark/bm_vm2_super.rb (revision 32355) +++ benchmark/bm_vm2_super.rb (revision 32356) @@ -14,7 +14,7 @@ obj = CC.new i = 0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 obj.m i+=1 end Index: benchmark/bm_vm2_mutex.rb =================================================================== --- benchmark/bm_vm2_mutex.rb (revision 32355) +++ benchmark/bm_vm2_mutex.rb (revision 32356) @@ -3,7 +3,7 @@ m = Mutex.new i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 m.synchronize{} end Index: benchmark/bm_app_mandelbrot.rb =================================================================== --- benchmark/bm_app_mandelbrot.rb (revision 32355) +++ benchmark/bm_app_mandelbrot.rb (revision 32356) @@ -12,8 +12,8 @@ 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) Index: benchmark/bm_vm2_proc.rb =================================================================== --- benchmark/bm_vm2_proc.rb (revision 32355) +++ benchmark/bm_vm2_proc.rb (revision 32356) @@ -7,7 +7,7 @@ } i=0 -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 i+=1 pr.call end Index: benchmark/bm_so_lists.rb =================================================================== --- benchmark/bm_so_lists.rb (revision 32355) +++ benchmark/bm_so_lists.rb (revision 32356) @@ -1,6 +1,6 @@ #from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby -NUM = 100 +NUM = 300 SIZE = 10000 def test_lists() Index: benchmark/bm_app_erb.rb =================================================================== --- benchmark/bm_app_erb.rb (revision 32355) +++ benchmark/bm_app_erb.rb (revision 32356) @@ -5,7 +5,7 @@ require 'erb' data = DATA.read -max = 5_000 +max = 15_000 title = "hello world!" content = "hello world!\n" * 10 Index: benchmark/bm_vm1_rescue.rb =================================================================== --- benchmark/bm_vm1_rescue.rb (revision 32355) +++ benchmark/bm_vm1_rescue.rb (revision 32356) @@ -1,5 +1,5 @@ i=0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+=1 begin rescue Index: benchmark/bm_vm2_eval.rb =================================================================== --- benchmark/bm_vm2_eval.rb (revision 32355) +++ benchmark/bm_vm2_eval.rb (revision 32356) @@ -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 Index: benchmark/bm_so_sieve.rb =================================================================== --- benchmark/bm_so_sieve.rb (revision 32355) +++ benchmark/bm_so_sieve.rb (revision 32356) @@ -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 Index: benchmark/bm_vm_thread_mutex2.rb =================================================================== --- benchmark/bm_vm_thread_mutex2.rb (revision 32355) +++ benchmark/bm_vm_thread_mutex2.rb (revision 32356) @@ -3,7 +3,7 @@ require 'thread' m = Mutex.new r = 0 -max = 1000 +max = 2000 lmax = (max * max)/2 (1..2).map{ Thread.new{ Index: benchmark/bm_io_file_create.rb =================================================================== --- benchmark/bm_io_file_create.rb (revision 32355) +++ benchmark/bm_io_file_create.rb (revision 32356) @@ -2,7 +2,7 @@ # Create files # -max = 50_000 +max = 200_000 file = './tmpfile_of_bm_io_file_create' max.times{ Index: benchmark/bm_app_strconcat.rb =================================================================== --- benchmark/bm_app_strconcat.rb (revision 32355) +++ benchmark/bm_app_strconcat.rb (revision 32356) @@ -1,5 +1,5 @@ i=0 -while i<500000 +while i<2_000_000 "#{1+1} #{1+1} #{1+1}" i+=1 end Index: benchmark/bm_so_matrix.rb =================================================================== --- benchmark/bm_so_matrix.rb (revision 32355) +++ benchmark/bm_so_matrix.rb (revision 32356) @@ -5,7 +5,7 @@ n = 60 #Integer(ARGV.shift || 1) -size = 30 +size = 40 def mkmatrix(rows, cols) count = 1 Index: benchmark/bm_vm1_neq.rb =================================================================== --- benchmark/bm_vm1_neq.rb (revision 32355) +++ benchmark/bm_vm1_neq.rb (revision 32356) @@ -2,7 +2,7 @@ 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 Index: benchmark/bm_vm_thread_mutex1.rb =================================================================== --- benchmark/bm_vm_thread_mutex1.rb (revision 32355) +++ benchmark/bm_vm_thread_mutex1.rb (revision 32356) @@ -3,7 +3,7 @@ require 'thread' m = Mutex.new r = 0 -max = 1000 +max = 2000 lmax = max * max (1..1).map{ Thread.new{ Index: benchmark/bm_vm2_zsuper.rb =================================================================== --- benchmark/bm_vm2_zsuper.rb (revision 32355) +++ benchmark/bm_vm2_zsuper.rb (revision 32356) @@ -14,7 +14,7 @@ obj = CC.new -while i<6000000 # benchmark loop 2 +while i<6_000_000 # benchmark loop 2 obj.m 10 i+=1 end Index: benchmark/bm_vm2_regexp.rb =================================================================== --- benchmark/bm_vm2_regexp.rb (revision 32355) +++ benchmark/bm_vm2_regexp.rb (revision 32356) @@ -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 Index: benchmark/bm_so_random.rb =================================================================== --- benchmark/bm_so_random.rb (revision 32355) +++ benchmark/bm_so_random.rb (revision 32356) @@ -10,7 +10,7 @@ (max * ($last = ($last * IA + IC) % IM)) / IM end -N = 1000000 +N = 3_000_000 i=0 while i<N Index: benchmark/bm_vm2_defined_method.rb =================================================================== --- benchmark/bm_vm2_defined_method.rb (revision 32355) +++ benchmark/bm_vm2_defined_method.rb (revision 32356) @@ -3,7 +3,7 @@ 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 Index: benchmark/bm_vm1_ensure.rb =================================================================== --- benchmark/bm_vm1_ensure.rb (revision 32355) +++ benchmark/bm_vm1_ensure.rb (revision 32356) @@ -1,5 +1,5 @@ i=0 -while i<30000000 # benchmark loop 1 +while i<30_000_000 # benchmark loop 1 i+=1 begin begin Index: benchmark/bm_so_concatenate.rb =================================================================== --- benchmark/bm_so_concatenate.rb (revision 32355) +++ benchmark/bm_so_concatenate.rb (revision 32356) @@ -9,7 +9,7 @@ while i<10 i+=1 hello = '' - 400000.times do |e| + 4_000_000.times do |e| hello << STUFF end end Index: benchmark/bm_vm1_swap.rb =================================================================== --- benchmark/bm_vm1_swap.rb (revision 32355) +++ benchmark/bm_vm1_swap.rb (revision 32356) @@ -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 Index: benchmark/bm_so_fannkuch.rb =================================================================== --- benchmark/bm_so_fannkuch.rb (revision 32355) +++ benchmark/bm_so_fannkuch.rb (revision 32356) @@ -40,6 +40,6 @@ def puts *args end -N = 10 # (ARGV[0] || 1).to_i +N = 9 # (ARGV[0] || 1).to_i puts "Pfannkuchen(#{N}) = #{fannkuch(N)}" Index: benchmark/bm_vm2_case.rb =================================================================== --- benchmark/bm_vm2_case.rb (revision 32355) +++ benchmark/bm_vm2_case.rb (revision 32356) @@ -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 Index: benchmark/bm_vm2_array.rb =================================================================== --- benchmark/bm_vm2_array.rb (revision 32355) +++ benchmark/bm_vm2_array.rb (revision 32356) @@ -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 Index: benchmark/bm_vm2_method.rb =================================================================== --- benchmark/bm_vm2_method.rb (revision 32355) +++ benchmark/bm_vm2_method.rb (revision 32356) @@ -3,7 +3,7 @@ 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 Index: benchmark/bm_app_factorial.rb =================================================================== --- benchmark/bm_app_factorial.rb (revision 32355) +++ benchmark/bm_app_factorial.rb (revision 32356) @@ -6,6 +6,6 @@ end end -8.times{ +100.times { fact(5000) -} \ No newline at end of file +} Index: benchmark/bm_vm2_poly_method.rb =================================================================== --- benchmark/bm_vm2_poly_method.rb (revision 32355) +++ benchmark/bm_vm2_poly_method.rb (revision 32356) @@ -13,7 +13,7 @@ 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 Index: benchmark/bm_vm1_const.rb =================================================================== --- benchmark/bm_vm1_const.rb (revision 32355) +++ benchmark/bm_vm1_const.rb (revision 32356) @@ -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 Index: benchmark/bm_vm1_simplereturn.rb =================================================================== --- benchmark/bm_vm1_simplereturn.rb (revision 32355) +++ benchmark/bm_vm1_simplereturn.rb (revision 32356) @@ -2,7 +2,7 @@ return 1 end i=0 -while i<30000000 # while loop 1 +while i<30_000_000 # while loop 1 i+=1 m end Index: benchmark/bm_vm1_block.rb =================================================================== --- benchmark/bm_vm1_block.rb (revision 32355) +++ benchmark/bm_vm1_block.rb (revision 32356) @@ -3,8 +3,8 @@ 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 Index: benchmark/bm_vm1_not.rb =================================================================== --- benchmark/bm_vm1_not.rb (revision 32355) +++ benchmark/bm_vm1_not.rb (revision 32356) @@ -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 Index: benchmark/bm_vm1_ivar.rb =================================================================== --- benchmark/bm_vm1_ivar.rb (revision 32355) +++ benchmark/bm_vm1_ivar.rb (revision 32356) @@ -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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/