ruby-changes:51685
From: k0kubun <ko1@a...>
Date: Mon, 9 Jul 2018 02:20:08 +0900 (JST)
Subject: [ruby-changes:51685] k0kubun:r63897 (trunk): benchmark/vm2_*.yml: fix ugly conversion errors
k0kubun 2018-07-09 02:19:57 +0900 (Mon, 09 Jul 2018) New Revision: 63897 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63897 Log: benchmark/vm2_*.yml: fix ugly conversion errors Modified files: trunk/benchmark/vm2_array.yml trunk/benchmark/vm2_defined_method.yml trunk/benchmark/vm2_eval.yml trunk/benchmark/vm2_method.yml trunk/benchmark/vm2_method_missing.yml trunk/benchmark/vm2_method_with_block.yml trunk/benchmark/vm2_module_ann_const_set.yml trunk/benchmark/vm2_mutex.yml trunk/benchmark/vm2_newlambda.yml trunk/benchmark/vm2_poly_method.yml trunk/benchmark/vm2_poly_method_ov.yml trunk/benchmark/vm2_poly_singleton.yml trunk/benchmark/vm2_proc.yml trunk/benchmark/vm2_send.yml trunk/benchmark/vm2_string_literal.yml trunk/benchmark/vm2_struct_big_aref_hi.yml trunk/benchmark/vm2_struct_big_aref_lo.yml trunk/benchmark/vm2_struct_big_aset.yml trunk/benchmark/vm2_struct_big_href_hi.yml trunk/benchmark/vm2_struct_big_href_lo.yml trunk/benchmark/vm2_struct_big_hset.yml trunk/benchmark/vm2_struct_small_aref.yml trunk/benchmark/vm2_struct_small_aset.yml trunk/benchmark/vm2_struct_small_href.yml trunk/benchmark/vm2_struct_small_hset.yml trunk/benchmark/vm2_super.yml Index: benchmark/vm2_struct_small_aset.yml =================================================================== --- benchmark/vm2_struct_small_aset.yml (revision 63896) +++ benchmark/vm2_struct_small_aset.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_small_aset.yml#L2 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 Index: benchmark/vm2_struct_big_hset.yml =================================================================== --- benchmark/vm2_struct_big_hset.yml (revision 63896) +++ benchmark/vm2_struct_big_hset.yml (revision 63897) @@ -1,8 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_big_hset.yml#L1 -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 Index: benchmark/vm2_struct_big_href_hi.yml =================================================================== --- benchmark/vm2_struct_big_href_hi.yml (revision 63896) +++ benchmark/vm2_struct_big_href_hi.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_big_href_hi.yml#L2 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 Index: benchmark/vm2_newlambda.yml =================================================================== --- benchmark/vm2_newlambda.yml (revision 63896) +++ benchmark/vm2_newlambda.yml (revision 63897) @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_newlambda.yml#L1 benchmark: - vm2_newlambda: 'lambda {} - -' + vm2_newlambda: | + lambda {} loop_count: 6000000 Index: benchmark/vm2_struct_small_hset.yml =================================================================== --- benchmark/vm2_struct_small_hset.yml (revision 63896) +++ benchmark/vm2_struct_small_hset.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_small_hset.yml#L2 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 Index: benchmark/vm2_struct_small_aref.yml =================================================================== --- benchmark/vm2_struct_small_aref.yml (revision 63896) +++ benchmark/vm2_struct_small_aref.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_small_aref.yml#L2 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 Index: benchmark/vm2_method_missing.yml =================================================================== --- benchmark/vm2_method_missing.yml (revision 63896) +++ benchmark/vm2_method_missing.yml (revision 63897) @@ -6,7 +6,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_method_missing.yml#L6 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 Index: benchmark/vm2_method.yml =================================================================== --- benchmark/vm2_method.yml (revision 63896) +++ benchmark/vm2_method.yml (revision 63897) @@ -3,7 +3,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_method.yml#L3 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 Index: benchmark/vm2_struct_small_href.yml =================================================================== --- benchmark/vm2_struct_small_href.yml (revision 63896) +++ benchmark/vm2_struct_small_href.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_small_href.yml#L2 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 Index: benchmark/vm2_struct_big_aref_hi.yml =================================================================== --- benchmark/vm2_struct_big_aref_hi.yml (revision 63896) +++ benchmark/vm2_struct_big_aref_hi.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_big_aref_hi.yml#L2 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 Index: benchmark/vm2_poly_method_ov.yml =================================================================== --- benchmark/vm2_poly_method_ov.yml (revision 63896) +++ benchmark/vm2_poly_method_ov.yml (revision 63897) @@ -1,19 +1,24 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_poly_method_ov.yml#L1 -prelude: | - class C1 - def m - 1 +# loop_count is not utilized since `i` is involved in the script +benchmark: + vm2_poly_method_ov: | + class C1 + def m + 1 + end end - end - class C2 - def m - 2 + class C2 + def m + 2 + end end - end - o1 = C1.new - o2 = C2.new -benchmark: - vm2_poly_method_ov: | - o = (i % 2 == 0) ? o1 : o2 + 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 Index: benchmark/vm2_send.yml =================================================================== --- benchmark/vm2_send.yml (revision 63896) +++ benchmark/vm2_send.yml (revision 63897) @@ -6,7 +6,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_send.yml#L6 o = C.new benchmark: - vm2_send: 'o.__send__ :m - -' + vm2_send: | + o.__send__ :m loop_count: 6000000 Index: benchmark/vm2_array.yml =================================================================== --- benchmark/vm2_array.yml (revision 63896) +++ benchmark/vm2_array.yml (revision 63897) @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_array.yml#L1 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 Index: benchmark/vm2_defined_method.yml =================================================================== --- benchmark/vm2_defined_method.yml (revision 63896) +++ benchmark/vm2_defined_method.yml (revision 63897) @@ -3,7 +3,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_defined_method.yml#L3 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 Index: benchmark/vm2_string_literal.yml =================================================================== --- benchmark/vm2_string_literal.yml (revision 63896) +++ benchmark/vm2_string_literal.yml (revision 63897) @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_string_literal.yml#L1 benchmark: - vm2_string_literal: 'x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - -' + vm2_string_literal: | + x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" loop_count: 6000000 Index: benchmark/vm2_super.yml =================================================================== --- benchmark/vm2_super.yml (revision 63896) +++ benchmark/vm2_super.yml (revision 63897) @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_super.yml#L1 -prelude: |2 - +prelude: | class C def m 1 @@ -14,7 +13,5 @@ prelude: |2 https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_super.yml#L13 obj = CC.new benchmark: - vm2_super: 'obj.m - -' + vm2_super: obj.m loop_count: 6000000 Index: benchmark/vm2_mutex.yml =================================================================== --- benchmark/vm2_mutex.yml (revision 63896) +++ benchmark/vm2_mutex.yml (revision 63897) @@ -3,7 +3,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_mutex.yml#L3 m = Thread::Mutex.new benchmark: - vm2_mutex: 'm.synchronize{} - -' + vm2_mutex: | + m.synchronize{} loop_count: 6000000 Index: benchmark/vm2_struct_big_href_lo.yml =================================================================== --- benchmark/vm2_struct_big_href_lo.yml (revision 63896) +++ benchmark/vm2_struct_big_href_lo.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_big_href_lo.yml#L2 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 Index: benchmark/vm2_proc.yml =================================================================== --- benchmark/vm2_proc.yml (revision 63896) +++ benchmark/vm2_proc.yml (revision 63897) @@ -7,7 +7,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_proc.yml#L7 a = 1 } benchmark: - vm2_proc: 'pr.call - -' + vm2_proc: | + pr.call loop_count: 6000000 Index: benchmark/vm2_eval.yml =================================================================== --- benchmark/vm2_eval.yml (revision 63896) +++ benchmark/vm2_eval.yml (revision 63897) @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_eval.yml#L1 benchmark: - vm2_eval: 'eval("1") - -' + vm2_eval: | + eval("1") loop_count: 6000000 Index: benchmark/vm2_module_ann_const_set.yml =================================================================== --- benchmark/vm2_module_ann_const_set.yml (revision 63896) +++ benchmark/vm2_module_ann_const_set.yml (revision 63897) @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_module_ann_const_set.yml#L1 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 Index: benchmark/vm2_poly_method.yml =================================================================== --- benchmark/vm2_poly_method.yml (revision 63896) +++ benchmark/vm2_poly_method.yml (revision 63897) @@ -1,19 +1,24 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_poly_method.yml#L1 -prelude: | - class C1 - def m - 1 +# loop_count is not utilized since `i` is involved in the script +benchmark: + vm2_poly_method: | + class C1 + def m + 1 + end end - end - class C2 - def m - 2 + class C2 + def m + 2 + end end - end - 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 + 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 Index: benchmark/vm2_struct_big_aref_lo.yml =================================================================== --- benchmark/vm2_struct_big_aref_lo.yml (revision 63896) +++ benchmark/vm2_struct_big_aref_lo.yml (revision 63897) @@ -2,7 +2,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_big_aref_lo.yml#L2 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 Index: benchmark/vm2_poly_singleton.yml =================================================================== --- benchmark/vm2_poly_singleton.yml (revision 63896) +++ benchmark/vm2_poly_singleton.yml (revision 63897) @@ -1,13 +1,18 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_poly_singleton.yml#L1 -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 Index: benchmark/vm2_struct_big_aset.yml =================================================================== --- benchmark/vm2_struct_big_aset.yml (revision 63896) +++ benchmark/vm2_struct_big_aset.yml (revision 63897) @@ -1,8 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_struct_big_aset.yml#L1 -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 Index: benchmark/vm2_method_with_block.yml =================================================================== --- benchmark/vm2_method_with_block.yml (revision 63896) +++ benchmark/vm2_method_with_block.yml (revision 63897) @@ -3,7 +3,6 @@ prelude: | https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_method_with_block.yml#L3 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/