[ruby-cvs:72173] k0kubun:r65073 (trunk): _mjit_compile_getivar.erb: optimize IC-hit getivar

k0kubun at ruby-lang.org k0kubun at ruby-lang.org
Sun Oct 14 18:24:43 JST 2018


k0kubun	2018-10-14 18:24:43 +0900 (Sun, 14 Oct 2018)

  New Revision: 65073

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65073

  Log:
    _mjit_compile_getivar.erb: optimize IC-hit getivar
    
    by inlining index (and serial to invalidate that) and simplifying the
    branch by using JIT cancellation.
    
    mjit_compile.inc.erb: use the above file
    mjit_compile.c: copy USE_IC_FOR_IVAR definition. will move this to
    another shared file later.
    common.mk: add new dependency
    test/ruby/test_jit.rb: cover this case
    
    === Optcarrot benchmark ===
    ```
    $ benchmark-driver benchmark.yml --rbenv '2.0.0::2.0.0-p648;before::before --disable-gems;before+JIT::before --disable-gems --jit;after::after --disable-gems;after+JIT::after --disable-gems --jit' -v --repeat-count 24
    2.0.0: ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
    before: ruby 2.6.0dev (2018-10-14 trunk 65072) [x86_64-linux]
    before+JIT: ruby 2.6.0dev (2018-10-14 trunk 65072) +JIT [x86_64-linux]
    after: ruby 2.6.0dev (2018-10-14 trunk 65072) [x86_64-linux]
    last_commit=_mjit_compile_getivar.erb: optimize IC-hit getivar
    after+JIT: ruby 2.6.0dev (2018-10-14 trunk 65072) +JIT [x86_64-linux]
    last_commit=_mjit_compile_getivar.erb: optimize IC-hit getivar
    Calculating -------------------------------------
                                  2.0.0      before  before+JIT       after   after+JIT
    Optcarrot Lan_Master.nes     36.065      53.896      71.565      53.856      84.747 fps
    
    Comparison:
                 Optcarrot Lan_Master.nes
                   after+JIT:        84.7 fps
                  before+JIT:        71.6 fps - 1.18x  slower
                      before:        53.9 fps - 1.57x  slower
                       after:        53.9 fps - 1.57x  slower
                       2.0.0:        36.1 fps - 2.35x  slower
    
    ```

  Added files:
    trunk/tool/ruby_vm/views/_mjit_compile_getivar.erb
  Modified files:
    trunk/common.mk
    trunk/mjit_compile.c
    trunk/test/ruby/test_jit.rb
    trunk/tool/ruby_vm/views/mjit_compile.inc.erb


More information about the ruby-cvs mailing list