From aef5f90281d470449fa785f8778b3223a02afd2e Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 17 Oct 2012 07:26:58 +0000 Subject: * 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 --- benchmark/bm_vm2_method_missing.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 benchmark/bm_vm2_method_missing.rb (limited to 'benchmark') 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 -- cgit v1.2.3