[前][次][番号順一覧][スレッド一覧]

ruby-changes:54594

From: k0kubun <ko1@a...>
Date: Mon, 14 Jan 2019 13:49:32 +0900 (JST)
Subject: [ruby-changes:54594] k0kubun:r66809 (trunk): vm_insnhelper.c: make VM helpers inline

k0kubun	2019-01-14 13:49:28 +0900 (Mon, 14 Jan 2019)

  New Revision: 66809

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

  Log:
    vm_insnhelper.c: make VM helpers inline
    
    In r66597, both VM and JIT seem to be made slower:
    
    ```
    $ benchmark-driver benchmark.yml --rbenv 'r66596::before --disable-gems;r66597::after --disable-gems;r66596+JIT::before --disable-gems --jit;r66597+JIT::after --disable-gems --jit' -v --repeat-count 24
    r66596: ruby 2.7.0dev (2018-12-28 trunk 66596) [x86_64-linux]
    r66597: ruby 2.7.0dev (2018-12-28 trunk 66597) [x86_64-linux]
    r66596+JIT: ruby 2.7.0dev (2018-12-28 trunk 66596) +JIT [x86_64-linux]
    r66597+JIT: ruby 2.7.0dev (2018-12-28 trunk 66597) +JIT [x86_64-linux]
    Calculating -------------------------------------
                                 r66596      r66597  r66596+JIT  r66597+JIT
    Optcarrot Lan_Master.nes     55.174      54.620      88.011      85.326 fps
    
    Comparison:
                 Optcarrot Lan_Master.nes
                  r66596+JIT:        88.0 fps
                  r66597+JIT:        85.3 fps - 1.03x  slower
                      r66596:        55.2 fps - 1.60x  slower
                      r66597:        54.6 fps - 1.61x  slower
    ```
    
    This commit makes JIT's situation a little better. But in 2.7 we seem to
    have some other regressions after that, and this can't still resurrect the
    2.6.0's performance.
    
    ```
    $ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems;after::after --disable-gems;before+JIT::before --disable-gems --jit;after+JIT::after --disable-gems --jit' -v --repeat-count 24
    before: ruby 2.7.0dev (2019-01-13 trunk 66808) [x86_64-linux]
    after: ruby 2.7.0dev (2019-01-13 trunk 66808) [x86_64-linux]
    last_commit=vm_insnhelper.c: make VM helpers inline
    before+JIT: ruby 2.7.0dev (2019-01-13 trunk 66808) +JIT [x86_64-linux]
    after+JIT: ruby 2.7.0dev (2019-01-13 trunk 66808) +JIT [x86_64-linux]
    last_commit=vm_insnhelper.c: make VM helpers inline
    Calculating -------------------------------------
                                 before       after  before+JIT   after+JIT
    Optcarrot Lan_Master.nes     51.710      51.535      83.629      85.486 fps
    
    Comparison:
                 Optcarrot Lan_Master.nes
                   after+JIT:        85.5 fps
                  before+JIT:        83.6 fps - 1.02x  slower
                      before:        51.7 fps - 1.65x  slower
                       after:        51.5 fps - 1.66x  slower
    ```

  Modified files:
    trunk/vm_insnhelper.c
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 66808)
+++ vm_insnhelper.c	(revision 66809)
@@ -1391,7 +1391,7 @@ opt_equal_fallback(VALUE recv, VALUE obj https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1391
 #define BUILTIN_CLASS_P(x, k) (!SPECIAL_CONST_P(x) && RBASIC_CLASS(x) == k)
 #define EQ_UNREDEFINED_P(t) BASIC_OP_UNREDEFINED_P(BOP_EQ, t##_REDEFINED_OP_FLAG)
 
-static bool
+static inline bool
 FIXNUM_2_P(VALUE a, VALUE b)
 {
     /* FIXNUM_P(a) && FIXNUM_P(b)
@@ -1403,7 +1403,7 @@ FIXNUM_2_P(VALUE a, VALUE b) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1403
     return z == 1;
 }
 
-static bool
+static inline bool
 FLONUM_2_P(VALUE a, VALUE b)
 {
 #if USE_FLONUM
@@ -1654,7 +1654,7 @@ rb_simple_iseq_p(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1654
 	   iseq->body->param.flags.has_block == FALSE;
 }
 
-static void
+static inline void
 CALLER_SETUP_ARG(struct rb_control_frame_struct *restrict cfp,
                  struct rb_calling_info *restrict calling,
                  const struct rb_call_info *restrict ci)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]