summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-20 19:11:20 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-20 19:11:20 +0000
commitc629aecbc810e8014a88943a2b3ddcb716aa6ffb (patch)
treeed2f36eec95b38b9a3e157690d45da9b2909f3f8 /benchmark
parent3fffbe1e82d974a3bb6cdba58733086a369d4b06 (diff)
* 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). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bm_vm2_case.rb14
1 files changed, 14 insertions, 0 deletions
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
+