diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | benchmark/bm_vm2_case.rb | 14 |
2 files changed, 21 insertions, 0 deletions
@@ -1,3 +1,10 @@ +Tue Aug 21 04:09:06 2007 Koichi Sasada <ko1@atdot.net> + + * benchmark/bm_vm2_case.rb: add a new benchmark. + YARV optimize case/when syntax. If every conditions + are literal (such as Symbol, Fixnum, String), dispatch + calc order will be O(1). + Tue Aug 21 04:08:07 2007 Koichi Sasada <ko1@atdot.net> * test/ruby/test_enumerator.rb: fix last commit. diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb new file mode 100644 index 0000000000..efbd366ebb --- /dev/null +++ b/benchmark/bm_vm2_case.rb @@ -0,0 +1,14 @@ +i=0
+while i<6000000 # while loop 2
+ case :foo
+ when :bar
+ raise
+ when :baz
+ raise
+ when :boo
+ raise
+ when :foo
+ i+=1
+ end
+end
+
|