ruby-changes:25178
From: ko1 <ko1@a...>
Date: Wed, 17 Oct 2012 05:37:37 +0900 (JST)
Subject: [ruby-changes:25178] ko1:r37230 (trunk): * benchmark/bm_vm1_yield.rb: add a benchmark to measure `yield'
ko1 2012-10-17 05:37:25 +0900 (Wed, 17 Oct 2012) New Revision: 37230 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37230 Log: * benchmark/bm_vm1_yield.rb: add a benchmark to measure `yield' (invoke empty block) performance. * benchmark/bm_vm2_method_with_block.rb: add a benchmark to measure method invocation with empty block. Added files: trunk/benchmark/bm_vm1_yield.rb trunk/benchmark/bm_vm2_method_with_block.rb Modified files: trunk/ChangeLog Index: ChangeLog =================================================================== --- ChangeLog (revision 37229) +++ ChangeLog (revision 37230) @@ -1,3 +1,11 @@ +Wed Oct 17 05:35:37 2012 Koichi Sasada <ko1@a...> + + * benchmark/bm_vm1_yield.rb: add a benchmark to measure `yield' + (invoke empty block) performance. + + * benchmark/bm_vm2_method_with_block.rb: add a benchmark to measure + method invocation with empty block. + Wed Oct 17 05:05:07 2012 Koichi Sasada <ko1@a...> * vm_insnhelper.c (vm_invoke_block): vm_caller_setup_args() can skip Index: benchmark/bm_vm2_method_with_block.rb =================================================================== --- benchmark/bm_vm2_method_with_block.rb (revision 0) +++ benchmark/bm_vm2_method_with_block.rb (revision 37230) @@ -0,0 +1,9 @@ +def m + nil +end + +i = 0 +while i<6_000_000 # benchmark loop 2 + i += 1 + m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{}; +end Index: benchmark/bm_vm1_yield.rb =================================================================== --- benchmark/bm_vm1_yield.rb (revision 0) +++ benchmark/bm_vm1_yield.rb (revision 37230) @@ -0,0 +1,10 @@ +def m + i = 0 + while i<30_000_000 # while loop 1 + i += 1 + yield + end +end + +m{} + -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/