diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-17 07:26:58 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-17 07:26:58 +0000 |
commit | aef5f90281d470449fa785f8778b3223a02afd2e (patch) | |
tree | 8dbfbd0cb3fe9c1af4e5c45b71af3e7e40fd64a7 | |
parent | 000ff5b3ce9ff045a30e146aede5917d6fa4f0ff (diff) |
* benchmark/bm_vm2_method_missing.rb: add a benchmark to measure
performance of invoking `method_missing'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | benchmark/bm_vm2_method_missing.rb | 12 |
2 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Oct 17 16:25:34 2012 Koichi Sasada <[email protected]> + + * benchmark/bm_vm2_method_missing.rb: add a benchmark to measure + performance of invoking `method_missing'. + Wed Oct 17 16:23:17 2012 Koichi Sasada <[email protected]> * vm_insnhelper.c (vm_getivar): fix to use `aux.index' instead of diff --git a/benchmark/bm_vm2_method_missing.rb b/benchmark/bm_vm2_method_missing.rb new file mode 100644 index 0000000000..2badc73101 --- /dev/null +++ b/benchmark/bm_vm2_method_missing.rb @@ -0,0 +1,12 @@ +class C + def method_missing mid + end +end + +obj = C.new + +i = 0 +while i<6_000_000 # benchmark loop 2 + i += 1 + obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; +end |