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 /benchmark/bm_vm2_method_missing.rb | |
parent | 000ff5b3ce9ff045a30e146aede5917d6fa4f0ff (diff) | |
download | ruby-aef5f90281d470449fa785f8778b3223a02afd2e.tar.gz |
* 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
Diffstat (limited to 'benchmark/bm_vm2_method_missing.rb')
-rw-r--r-- | benchmark/bm_vm2_method_missing.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |