diff --git a/benchmark/vm2_array.yml b/benchmark/vm2_array.yml index 6bed8e3df0..7373098d5e 100644 --- a/benchmark/vm2_array.yml +++ b/benchmark/vm2_array.yml @@ -1,5 +1,4 @@ benchmark: - vm2_array: 'a = [1,2,3,4,5,6,7,8,9,10] - -' + vm2_array: | + a = [1,2,3,4,5,6,7,8,9,10] loop_count: 6000000 diff --git a/benchmark/vm2_defined_method.yml b/benchmark/vm2_defined_method.yml index 8bc65cfe17..e1b0d55674 100644 --- a/benchmark/vm2_defined_method.yml +++ b/benchmark/vm2_defined_method.yml @@ -3,7 +3,6 @@ prelude: | define_method(:m){} end benchmark: - vm2_defined_method: 'm; m; m; m; m; m; m; m; - -' + vm2_defined_method: | + m; m; m; m; m; m; m; m; loop_count: 6000000 diff --git a/benchmark/vm2_eval.yml b/benchmark/vm2_eval.yml index 65b9359f44..d506a9c079 100644 --- a/benchmark/vm2_eval.yml +++ b/benchmark/vm2_eval.yml @@ -1,5 +1,4 @@ benchmark: - vm2_eval: 'eval("1") - -' + vm2_eval: | + eval("1") loop_count: 6000000 diff --git a/benchmark/vm2_method.yml b/benchmark/vm2_method.yml index 15baf0566d..cc7b9b28ff 100644 --- a/benchmark/vm2_method.yml +++ b/benchmark/vm2_method.yml @@ -3,7 +3,6 @@ prelude: | nil end benchmark: - vm2_method: 'm; m; m; m; m; m; m; m; - -' + vm2_method: | + m; m; m; m; m; m; m; m; loop_count: 6000000 diff --git a/benchmark/vm2_method_missing.yml b/benchmark/vm2_method_missing.yml index 67e8838dbf..cbfb794b25 100644 --- a/benchmark/vm2_method_missing.yml +++ b/benchmark/vm2_method_missing.yml @@ -6,7 +6,6 @@ prelude: | obj = C.new benchmark: - vm2_method_missing: 'obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; - -' + vm2_method_missing: | + obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; loop_count: 6000000 diff --git a/benchmark/vm2_method_with_block.yml b/benchmark/vm2_method_with_block.yml index ab4be774bc..6e522adccc 100644 --- a/benchmark/vm2_method_with_block.yml +++ b/benchmark/vm2_method_with_block.yml @@ -3,7 +3,6 @@ prelude: | nil end benchmark: - vm2_method_with_block: 'm{}; m{}; m{}; m{}; m{}; m{}; m{}; m{}; - -' + vm2_method_with_block: | + m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{}; loop_count: 6000000 diff --git a/benchmark/vm2_module_ann_const_set.yml b/benchmark/vm2_module_ann_const_set.yml index 4783bcec04..b0becd9d3d 100644 --- a/benchmark/vm2_module_ann_const_set.yml +++ b/benchmark/vm2_module_ann_const_set.yml @@ -1,5 +1,4 @@ benchmark: - vm2_module_ann_const_set: 'Module.new.const_set(:X, Module.new) - -' + vm2_module_ann_const_set: | + Module.new.const_set(:X, Module.new) loop_count: 6000000 diff --git a/benchmark/vm2_mutex.yml b/benchmark/vm2_mutex.yml index caa0e9abb8..c40a90444a 100644 --- a/benchmark/vm2_mutex.yml +++ b/benchmark/vm2_mutex.yml @@ -3,7 +3,6 @@ prelude: | m = Thread::Mutex.new benchmark: - vm2_mutex: 'm.synchronize{} - -' + vm2_mutex: | + m.synchronize{} loop_count: 6000000 diff --git a/benchmark/vm2_newlambda.yml b/benchmark/vm2_newlambda.yml index 6f7c516869..93133f9f30 100644 --- a/benchmark/vm2_newlambda.yml +++ b/benchmark/vm2_newlambda.yml @@ -1,5 +1,4 @@ benchmark: - vm2_newlambda: 'lambda {} - -' + vm2_newlambda: | + lambda {} loop_count: 6000000 diff --git a/benchmark/vm2_poly_method.yml b/benchmark/vm2_poly_method.yml index 65541515eb..0104bdfb66 100644 --- a/benchmark/vm2_poly_method.yml +++ b/benchmark/vm2_poly_method.yml @@ -1,19 +1,24 @@ -prelude: | - class C1 - def m - 1 - end - end - class C2 - def m - 2 - end - end - - o1 = C1.new - o2 = C2.new +# loop_count is not utilized since `i` is involved in the script 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 + class C1 + def m + 1 + end + end + class C2 + def m + 2 + end + end + + o1 = C1.new + o2 = C2.new + + i = 0 + while i<6_000_000 + 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 diff --git a/benchmark/vm2_poly_method_ov.yml b/benchmark/vm2_poly_method_ov.yml index b77a588009..3748073ba2 100644 --- a/benchmark/vm2_poly_method_ov.yml +++ b/benchmark/vm2_poly_method_ov.yml @@ -1,19 +1,24 @@ -prelude: | - class C1 - def m - 1 - end - end - class C2 - def m - 2 - end - end - - o1 = C1.new - o2 = C2.new +# loop_count is not utilized since `i` is involved in the script benchmark: vm2_poly_method_ov: | - o = (i % 2 == 0) ? o1 : o2 + class C1 + def m + 1 + end + end + class C2 + def m + 2 + end + end + + o1 = C1.new + o2 = C2.new + + i = 0 + while i<6_000_000 + 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 + i += 1 + end +loop_count: 1 diff --git a/benchmark/vm2_poly_singleton.yml b/benchmark/vm2_poly_singleton.yml index a22c3c3e9a..e58d7bfb37 100644 --- a/benchmark/vm2_poly_singleton.yml +++ b/benchmark/vm2_poly_singleton.yml @@ -1,13 +1,18 @@ -prelude: | - class C1 - def m; 1; end - end - - o1 = C1.new - o2 = C1.new - o2.singleton_class +# loop_count is not utilized since `i` is involved in the script benchmark: vm2_poly_singleton: | - 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 + class C1 + def m; 1; end + end + + o1 = C1.new + o2 = C1.new + o2.singleton_class + + 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 diff --git a/benchmark/vm2_proc.yml b/benchmark/vm2_proc.yml index 782e9ae0cb..5c36e936d9 100644 --- a/benchmark/vm2_proc.yml +++ b/benchmark/vm2_proc.yml @@ -7,7 +7,6 @@ prelude: | a = 1 } benchmark: - vm2_proc: 'pr.call - -' + vm2_proc: | + pr.call loop_count: 6000000 diff --git a/benchmark/vm2_send.yml b/benchmark/vm2_send.yml index 6011d3159b..44a12a27d9 100644 --- a/benchmark/vm2_send.yml +++ b/benchmark/vm2_send.yml @@ -6,7 +6,6 @@ prelude: | o = C.new benchmark: - vm2_send: 'o.__send__ :m - -' + vm2_send: | + o.__send__ :m loop_count: 6000000 diff --git a/benchmark/vm2_string_literal.yml b/benchmark/vm2_string_literal.yml index 265cf9b3a3..54b0aec1fe 100644 --- a/benchmark/vm2_string_literal.yml +++ b/benchmark/vm2_string_literal.yml @@ -1,5 +1,4 @@ benchmark: - vm2_string_literal: 'x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - -' + vm2_string_literal: | + x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" loop_count: 6000000 diff --git a/benchmark/vm2_struct_big_aref_hi.yml b/benchmark/vm2_struct_big_aref_hi.yml index 2db4f3c83d..eed1846d28 100644 --- a/benchmark/vm2_struct_big_aref_hi.yml +++ b/benchmark/vm2_struct_big_aref_hi.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(*('a'..'z').map { |x| x.to_sym }) x = s.new benchmark: - vm2_struct_big_aref_hi: 'x.z # x[25] - -' + vm2_struct_big_aref_hi: | + x.z # x[25] loop_count: 6000000 diff --git a/benchmark/vm2_struct_big_aref_lo.yml b/benchmark/vm2_struct_big_aref_lo.yml index 17b2b0ca5e..0915435b76 100644 --- a/benchmark/vm2_struct_big_aref_lo.yml +++ b/benchmark/vm2_struct_big_aref_lo.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(*('a'..'z').map { |x| x.to_sym }) x = s.new benchmark: - vm2_struct_big_aref_lo: 'x.k # x[10] - -' + vm2_struct_big_aref_lo: | + x.k # x[10] loop_count: 6000000 diff --git a/benchmark/vm2_struct_big_aset.yml b/benchmark/vm2_struct_big_aset.yml index 4578876961..6af50103d3 100644 --- a/benchmark/vm2_struct_big_aset.yml +++ b/benchmark/vm2_struct_big_aset.yml @@ -1,8 +1,11 @@ -prelude: | - s = Struct.new(*('a'..'z').map { |x| x.to_sym }) - x = s.new +# loop_count is not utilized since `i` is involved in the script benchmark: - vm2_struct_big_aset: 'x.k = i # x[10] = i - -' -loop_count: 6000000 + vm2_struct_big_aset: | + s = Struct.new(*('a'..'z').map { |x| x.to_sym }) + x = s.new + i = 0 + while i<6_000_000 + i += 1 + x.k = i # x[10] = i + end +loop_count: 1 diff --git a/benchmark/vm2_struct_big_href_hi.yml b/benchmark/vm2_struct_big_href_hi.yml index aa5d778030..60aa7fddf3 100644 --- a/benchmark/vm2_struct_big_href_hi.yml +++ b/benchmark/vm2_struct_big_href_hi.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(*('a'..'z').map { |x| x.to_sym }) x = s.new benchmark: - vm2_struct_big_href_hi: 'x[:z] - -' + vm2_struct_big_href_hi: | + x[:z] loop_count: 6000000 diff --git a/benchmark/vm2_struct_big_href_lo.yml b/benchmark/vm2_struct_big_href_lo.yml index d662816428..c55c0bd16c 100644 --- a/benchmark/vm2_struct_big_href_lo.yml +++ b/benchmark/vm2_struct_big_href_lo.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(*('a'..'z').map { |x| x.to_sym }) x = s.new benchmark: - vm2_struct_big_href_lo: 'x[:k] - -' + vm2_struct_big_href_lo: | + x[:k] loop_count: 6000000 diff --git a/benchmark/vm2_struct_big_hset.yml b/benchmark/vm2_struct_big_hset.yml index 963b668ce4..d199c5bd47 100644 --- a/benchmark/vm2_struct_big_hset.yml +++ b/benchmark/vm2_struct_big_hset.yml @@ -1,8 +1,11 @@ -prelude: | - s = Struct.new(*('a'..'z').map { |x| x.to_sym }) - x = s.new +# loop_count is not utilized since `i` is involved in the script benchmark: - vm2_struct_big_hset: 'x[:k] = i - -' -loop_count: 6000000 + vm2_struct_big_hset: | + s = Struct.new(*('a'..'z').map { |x| x.to_sym }) + x = s.new + i = 0 + while i<6_000_000 + i += 1 + x[:k] = i + end +loop_count: 1 diff --git a/benchmark/vm2_struct_small_aref.yml b/benchmark/vm2_struct_small_aref.yml index 22cd919735..83381bed3a 100644 --- a/benchmark/vm2_struct_small_aref.yml +++ b/benchmark/vm2_struct_small_aref.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(:a, :b, :c) x = s.new benchmark: - vm2_struct_small_aref: 'x.a - -' + vm2_struct_small_aref: | + x.a loop_count: 6000000 diff --git a/benchmark/vm2_struct_small_aset.yml b/benchmark/vm2_struct_small_aset.yml index e6a8a5e9c1..adb9f49da5 100644 --- a/benchmark/vm2_struct_small_aset.yml +++ b/benchmark/vm2_struct_small_aset.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(:a, :b, :c) x = s.new benchmark: - vm2_struct_small_aset: 'x.a = i - -' + vm2_struct_small_aset: | + x.a = i loop_count: 6000000 diff --git a/benchmark/vm2_struct_small_href.yml b/benchmark/vm2_struct_small_href.yml index c98122a59d..b744f070d1 100644 --- a/benchmark/vm2_struct_small_href.yml +++ b/benchmark/vm2_struct_small_href.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(:a, :b, :c) x = s.new benchmark: - vm2_struct_small_href: 'x[:a] - -' + vm2_struct_small_href: | + x[:a] loop_count: 6000000 diff --git a/benchmark/vm2_struct_small_hset.yml b/benchmark/vm2_struct_small_hset.yml index edfde8b429..d43845d6e0 100644 --- a/benchmark/vm2_struct_small_hset.yml +++ b/benchmark/vm2_struct_small_hset.yml @@ -2,7 +2,6 @@ prelude: | s = Struct.new(:a, :b, :c) x = s.new benchmark: - vm2_struct_small_hset: 'x[:a] = 1 - -' + vm2_struct_small_hset: | + x[:a] = 1 loop_count: 6000000 diff --git a/benchmark/vm2_super.yml b/benchmark/vm2_super.yml index 79da4ac63a..674743762a 100644 --- a/benchmark/vm2_super.yml +++ b/benchmark/vm2_super.yml @@ -1,5 +1,4 @@ -prelude: |2 - +prelude: | class C def m 1 @@ -14,7 +13,5 @@ prelude: |2 obj = CC.new benchmark: - vm2_super: 'obj.m - -' + vm2_super: obj.m loop_count: 6000000