summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 79fc15df9c..9e569fe583 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 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