1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/mjit_integer.yml
Takashi Kokubun dbb4f19969
Allow inlining Integer#-@ and #~
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' benchmark/mjit_integer.yml --filter '(comp|uminus)'
before --jit: ruby 3.0.0dev (2020-12-23T05:41:44Z master 0dd4896175) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-12-23T06:25:41Z master 8887d78992) +JIT [x86_64-linux]
last_commit=Allow inlining Integer#-@ and #~
Calculating -------------------------------------
                     before --jit  after --jit
        mjit_comp(1)      44.006M      70.417M i/s -     40.000M times in 0.908967s 0.568042s
      mjit_uminus(1)      44.333M      68.422M i/s -     40.000M times in 0.902255s 0.584603s

Comparison:
                     mjit_comp(1)
         after --jit:  70417331.4 i/s
        before --jit:  44005980.4 i/s - 1.60x  slower

                   mjit_uminus(1)
         after --jit:  68422468.8 i/s
        before --jit:  44333371.0 i/s - 1.54x  slower
```
2020-12-22 22:32:19 -08:00

30 lines
863 B
YAML

type: lib/benchmark_driver/runner/mjit
prelude: |
def mjit_abs(int) int.abs end
def mjit_bit_length(int) int.bit_length end
def mjit_comp(int) ~int end
def mjit_even?(int) int.even? end
def mjit_integer?(int) int.integer? end
def mjit_magnitude(int) int.magnitude end
def mjit_odd?(int) int.odd? end
def mjit_ord(int) int.ord end
def mjit_to_i(int) int.to_i end
def mjit_to_int(int) int.to_int end
def mjit_uminus(int) -int end
def mjit_zero?(int) int.zero? end
benchmark:
- mjit_abs(-1)
- mjit_bit_length(100)
- mjit_comp(1)
- mjit_even?(2)
- mjit_integer?(0)
- mjit_magnitude(-1)
- mjit_odd?(1)
- mjit_ord(1)
- mjit_to_i(1)
- mjit_to_int(1)
- mjit_uminus(1)
- mjit_zero?(0)
loop_count: 40000000