From a3e1b1ce7ed7e7ffac23015fc2fde56511b30681 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 31 Dec 2006 15:02:22 +0000 Subject: * Merge YARV git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/bm_vm2_poly_method.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 benchmark/bm_vm2_poly_method.rb (limited to 'benchmark/bm_vm2_poly_method.rb') diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb new file mode 100644 index 0000000000..3341ce6912 --- /dev/null +++ b/benchmark/bm_vm2_poly_method.rb @@ -0,0 +1,20 @@ +class C1 + def m + 1 + end +end +class C2 + def m + 2 + end +end + +o1 = C1.new +o2 = C2.new + +i=0 +while i<6000000 # benchmark loop 2 + o = (i % 2 == 0) ? o1 : o2 + o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m + i+=1 +end -- cgit v1.2.3