ruby--ruby/benchmark/mjit_opt_cc_insns.yml

28 lines
492 B
YAML

# 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