From c1bbb616d8be3f9f1231611b2576a6cea89033ae Mon Sep 17 00:00:00 2001 From: kosaki Date: Tue, 14 Jun 2011 19:30:12 +0000 Subject: * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ benchmark/bm_vm4_alive_check1.rb | 6 ------ benchmark/bm_vm4_pass_flood.rb | 8 -------- benchmark/bm_vm4_pipe.rb | 17 ----------------- benchmark/bm_vm4_thread_pass.rb | 15 --------------- benchmark/bm_vm_thread_alive_check1.rb | 6 ++++++ benchmark/bm_vm_thread_pass.rb | 15 +++++++++++++++ benchmark/bm_vm_thread_pass_flood.rb | 8 ++++++++ benchmark/bm_vm_thread_pipe.rb | 17 +++++++++++++++++ 9 files changed, 54 insertions(+), 46 deletions(-) delete mode 100644 benchmark/bm_vm4_alive_check1.rb delete mode 100644 benchmark/bm_vm4_pass_flood.rb delete mode 100644 benchmark/bm_vm4_pipe.rb delete mode 100644 benchmark/bm_vm4_thread_pass.rb create mode 100644 benchmark/bm_vm_thread_alive_check1.rb create mode 100644 benchmark/bm_vm_thread_pass.rb create mode 100644 benchmark/bm_vm_thread_pass_flood.rb create mode 100644 benchmark/bm_vm_thread_pipe.rb diff --git a/ChangeLog b/ChangeLog index e1e948a452..47822b665a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Jun 15 04:28:39 2011 KOSAKI Motohiro + + * 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 * benchmark/bm_vm4_pass_flood.rb: new benchmark for GVL fairness. diff --git a/benchmark/bm_vm4_alive_check1.rb b/benchmark/bm_vm4_alive_check1.rb deleted file mode 100644 index aebe99875d..0000000000 --- a/benchmark/bm_vm4_alive_check1.rb +++ /dev/null @@ -1,6 +0,0 @@ -5000.times{ - t = Thread.new{} - while t.alive? - Thread.pass - end -} diff --git a/benchmark/bm_vm4_pass_flood.rb b/benchmark/bm_vm4_pass_flood.rb deleted file mode 100644 index 56b5b0a956..0000000000 --- a/benchmark/bm_vm4_pass_flood.rb +++ /dev/null @@ -1,8 +0,0 @@ -1000.times{ - Thread.new{loop{Thread.pass}} -} - -i=0 -while i<10000 - i += 1 -end diff --git a/benchmark/bm_vm4_pipe.rb b/benchmark/bm_vm4_pipe.rb deleted file mode 100644 index 272d231eba..0000000000 --- a/benchmark/bm_vm4_pipe.rb +++ /dev/null @@ -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} - diff --git a/benchmark/bm_vm4_thread_pass.rb b/benchmark/bm_vm4_thread_pass.rb deleted file mode 100644 index b5b3c0bc85..0000000000 --- a/benchmark/bm_vm4_thread_pass.rb +++ /dev/null @@ -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} - - diff --git a/benchmark/bm_vm_thread_alive_check1.rb b/benchmark/bm_vm_thread_alive_check1.rb new file mode 100644 index 0000000000..aebe99875d --- /dev/null +++ b/benchmark/bm_vm_thread_alive_check1.rb @@ -0,0 +1,6 @@ +5000.times{ + t = Thread.new{} + while t.alive? + Thread.pass + end +} diff --git a/benchmark/bm_vm_thread_pass.rb b/benchmark/bm_vm_thread_pass.rb new file mode 100644 index 0000000000..b5b3c0bc85 --- /dev/null +++ b/benchmark/bm_vm_thread_pass.rb @@ -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} + + diff --git a/benchmark/bm_vm_thread_pass_flood.rb b/benchmark/bm_vm_thread_pass_flood.rb new file mode 100644 index 0000000000..56b5b0a956 --- /dev/null +++ b/benchmark/bm_vm_thread_pass_flood.rb @@ -0,0 +1,8 @@ +1000.times{ + Thread.new{loop{Thread.pass}} +} + +i=0 +while i<10000 + i += 1 +end diff --git a/benchmark/bm_vm_thread_pipe.rb b/benchmark/bm_vm_thread_pipe.rb new file mode 100644 index 0000000000..272d231eba --- /dev/null +++ b/benchmark/bm_vm_thread_pipe.rb @@ -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} + -- cgit v1.2.3