summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-17 07:26:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-17 07:26:58 +0000
commitaef5f90281d470449fa785f8778b3223a02afd2e (patch)
tree8dbfbd0cb3fe9c1af4e5c45b71af3e7e40fd64a7
parent000ff5b3ce9ff045a30e146aede5917d6fa4f0ff (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--ChangeLog5
-rw-r--r--benchmark/bm_vm2_method_missing.rb12
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 79fc15d..9e569fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Oct 17 16:25:34 2012 Koichi Sasada <ko1@atdot.net>
+
+ * 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 <ko1@atdot.net>
* 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 0000000..2badc73
--- /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