diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-08 17:03:23 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-08 17:03:23 +0000 |
commit | 12068aa4e980ab32a0438408a519030e65dabf5e (patch) | |
tree | d62bc1f1849ef9d5c9abd2c58d0ababde219f2b5 /benchmark/vm2_poly_method.yml | |
parent | 1aedeaa476a073d81d0539f66cfb4f6363b6766a (diff) | |
download | ruby-12068aa4e980ab32a0438408a519030e65dabf5e.tar.gz |
benchmark/vm2_*.yml: abstract away the while loop
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark/vm2_poly_method.yml')
-rw-r--r-- | benchmark/vm2_poly_method.yml | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/benchmark/vm2_poly_method.yml b/benchmark/vm2_poly_method.yml index b5e66a0c46..65541515eb 100644 --- a/benchmark/vm2_poly_method.yml +++ b/benchmark/vm2_poly_method.yml @@ -1,23 +1,19 @@ -benchmark: - vm2_poly_method: | - class C1 - def m - 1 - end +prelude: | + class C1 + def m + 1 end - class C2 - def m - 2 - end + end + class C2 + def m + 2 end + end - o1 = C1.new - o2 = C2.new - - i = 0 - while i<6_000_000 # 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 -loop_count: 1 + o1 = C1.new + o2 = C2.new +benchmark: + vm2_poly_method: | + o = (i % 2 == 0) ? o1 : o2 + o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m +loop_count: 6000000 |