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_opt_cc_insns.yml

28 lines
492 B
YAML
Raw Normal View History

# opt_* insns using vm_method_cfunc_is with send-compatible operands:
# * opt_nil_p
# * opt_not
# * opt_eq
type: lib/benchmark_driver/runner/mjit
prelude: |
def mjit_nil?(obj)
obj.nil?
end
def mjit_not(obj)
!obj
end
def mjit_eq(a, b)
a == b
end
benchmark:
- script: mjit_nil?(1)
loop_count: 40000000
- script: mjit_not(1)
loop_count: 40000000
- script: mjit_eq(1, nil)
loop_count: 8000000
- script: mjit_eq(nil, 1)
loop_count: 8000000