blob: fed6d34bd5e203966ec516ee554c37b7e8a828f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# 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
|