ruby-changes:20047
From: kosaki <ko1@a...>
Date: Wed, 15 Jun 2011 04:30:25 +0900 (JST)
Subject: [ruby-changes:20047] kosaki:r32094 (trunk): * benchmark/bm_vm4_thread_pass.rb: rename bm_vm4* to
kosaki 2011-06-15 04:30:12 +0900 (Wed, 15 Jun 2011) New Revision: 32094 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32094 Log: * benchmark/bm_vm4_thread_pass.rb: rename bm_vm4* to bm_vm_thread_*. suggested by ko1. * benchmark/bm_vm4_pipe.rb: ditto. * benchmark/bm_vm4_alive_check1.rb: ditto. * benchmark/bm_vm4_pass_flood.rb: ditto. Added files: trunk/benchmark/bm_vm_thread_alive_check1.rb trunk/benchmark/bm_vm_thread_pass.rb trunk/benchmark/bm_vm_thread_pass_flood.rb trunk/benchmark/bm_vm_thread_pipe.rb Removed files: trunk/benchmark/bm_vm4_alive_check1.rb trunk/benchmark/bm_vm4_pass_flood.rb trunk/benchmark/bm_vm4_pipe.rb trunk/benchmark/bm_vm4_thread_pass.rb Modified files: trunk/ChangeLog Index: ChangeLog =================================================================== --- ChangeLog (revision 32093) +++ ChangeLog (revision 32094) @@ -1,3 +1,11 @@ +Wed Jun 15 04:28:39 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * benchmark/bm_vm4_thread_pass.rb: rename bm_vm4* to + bm_vm_thread_*. suggested by ko1. + * benchmark/bm_vm4_pipe.rb: ditto. + * benchmark/bm_vm4_alive_check1.rb: ditto. + * benchmark/bm_vm4_pass_flood.rb: ditto. + Wed Jun 15 03:52:50 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * benchmark/bm_vm4_pass_flood.rb: new benchmark for GVL fairness. Index: benchmark/bm_vm4_thread_pass.rb =================================================================== --- benchmark/bm_vm4_thread_pass.rb (revision 32093) +++ benchmark/bm_vm4_thread_pass.rb (revision 32094) @@ -1,15 +0,0 @@ -# Plenty Thtread.pass -# A performance may depend on GVL implementation. - -tmax = (ARGV.shift || 2).to_i -lmax = 200_000 / tmax - -(1..tmax).map{ - Thread.new{ - lmax.times{ - Thread.pass - } - } -}.each{|t| t.join} - - Index: benchmark/bm_vm4_pipe.rb =================================================================== --- benchmark/bm_vm4_pipe.rb (revision 32093) +++ benchmark/bm_vm4_pipe.rb (revision 32094) @@ -1,17 +0,0 @@ -# Mesure small and plenty pipe read/write. -# A performance may depend on GVL implementation. - -lmax = 100_000 -r, w = IO.pipe -[Thread.new{ - lmax.times{ - w.write('a') - } - p "w:exit" -}, Thread.new{ - lmax.times{ - r.read(1) - } - p "r:exit" -}].each{|t| t.join} - Index: benchmark/bm_vm4_alive_check1.rb =================================================================== --- benchmark/bm_vm4_alive_check1.rb (revision 32093) +++ benchmark/bm_vm4_alive_check1.rb (revision 32094) @@ -1,6 +0,0 @@ -5000.times{ - t = Thread.new{} - while t.alive? - Thread.pass - end -} Index: benchmark/bm_vm4_pass_flood.rb =================================================================== --- benchmark/bm_vm4_pass_flood.rb (revision 32093) +++ benchmark/bm_vm4_pass_flood.rb (revision 32094) @@ -1,8 +0,0 @@ -1000.times{ - Thread.new{loop{Thread.pass}} -} - -i=0 -while i<10000 - i += 1 -end Index: benchmark/bm_vm_thread_alive_check1.rb =================================================================== --- benchmark/bm_vm_thread_alive_check1.rb (revision 0) +++ benchmark/bm_vm_thread_alive_check1.rb (revision 32094) @@ -0,0 +1,6 @@ +5000.times{ + t = Thread.new{} + while t.alive? + Thread.pass + end +} Property changes on: benchmark/bm_vm_thread_alive_check1.rb ___________________________________________________________________ Added: svn:eol-style + LF Index: benchmark/bm_vm_thread_pass.rb =================================================================== --- benchmark/bm_vm_thread_pass.rb (revision 0) +++ benchmark/bm_vm_thread_pass.rb (revision 32094) @@ -0,0 +1,15 @@ +# Plenty Thtread.pass +# A performance may depend on GVL implementation. + +tmax = (ARGV.shift || 2).to_i +lmax = 200_000 / tmax + +(1..tmax).map{ + Thread.new{ + lmax.times{ + Thread.pass + } + } +}.each{|t| t.join} + + Property changes on: benchmark/bm_vm_thread_pass.rb ___________________________________________________________________ Added: svn:eol-style + LF Index: benchmark/bm_vm_thread_pass_flood.rb =================================================================== --- benchmark/bm_vm_thread_pass_flood.rb (revision 0) +++ benchmark/bm_vm_thread_pass_flood.rb (revision 32094) @@ -0,0 +1,8 @@ +1000.times{ + Thread.new{loop{Thread.pass}} +} + +i=0 +while i<10000 + i += 1 +end Property changes on: benchmark/bm_vm_thread_pass_flood.rb ___________________________________________________________________ Added: svn:eol-style + LF Index: benchmark/bm_vm_thread_pipe.rb =================================================================== --- benchmark/bm_vm_thread_pipe.rb (revision 0) +++ benchmark/bm_vm_thread_pipe.rb (revision 32094) @@ -0,0 +1,17 @@ +# Mesure small and plenty pipe read/write. +# A performance may depend on GVL implementation. + +lmax = 100_000 +r, w = IO.pipe +[Thread.new{ + lmax.times{ + w.write('a') + } + p "w:exit" +}, Thread.new{ + lmax.times{ + r.read(1) + } + p "r:exit" +}].each{|t| t.join} + Property changes on: benchmark/bm_vm_thread_pipe.rb ___________________________________________________________________ Added: svn:eol-style + LF -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/