From: "tmm1 (Aman Gupta)" <ruby@...1.net> Date: 2013-12-08T11:10:12+09:00 Subject: [ruby-core:58957] [ruby-trunk - Bug #9227] use opt_aset ? Issue #9227 has been updated by tmm1 (Aman Gupta). Maybe some minor improvement on microbenchmarks. Before patch: ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.54s user 0.02s system 99% cpu 1.572 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.58s user 0.02s system 99% cpu 1.608 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.54s user 0.02s system 99% cpu 1.565 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.57s user 0.02s system 99% cpu 1.605 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.54s user 0.02s system 99% cpu 1.569 total After patch: ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.51s user 0.02s system 99% cpu 1.535 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.52s user 0.02s system 99% cpu 1.545 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.49s user 0.02s system 99% cpu 1.515 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.54s user 0.02s system 99% cpu 1.567 total ./miniruby -I. benchmark/bm_so_k_nucleotide.rb > /dev/null 1.50s user 0.02s system 99% cpu 1.530 total ---------------------------------------- Bug #9227: use opt_aset ? https://bugs.ruby-lang.org/issues/9227#change-43506 Author: tmm1 (Aman Gupta) Status: Open Priority: Normal Assignee: Category: Target version: current: 2.1.0 ruby -v: trunk Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN I noticed we have an opt_aset instruction, but nothing is using it. Is there some reason? diff --git a/compile.c b/compile.c index 812f692..9d9f14f 100644 --- a/compile.c +++ b/compile.c @@ -1955,6 +1955,11 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj) case idAREF: SP_INSN(aref); return COMPILE_OK; } break; + case 2: + switch (ci->mid) { + case idASET: SP_INSN(aset); return COMPILE_OK; + } + break; } } if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) { -- http://bugs.ruby-lang.org/