blob: 40136e5aa4c8904cdd469fd0e35ccfc1261f9927 (
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
28
29
30
31
32
33
34
35
36
37
|
prelude: |
define_method(:a0){}
define_method(:a1){|a| a}
define_method(:s){|*a| a}
define_method(:b){|kw: 1| kw}
t0 = 0.times.to_a
t1 = 1.times.to_a
t10 = 10.times.to_a
t100 = 100.times.to_a
kw = {kw: 2}
benchmark:
bmethod_simple_0: |
a0
bmethod_simple_1: |
a1(1)
bmethod_simple_0_splat: |
a0(*t0)
bmethod_simple_1_splat: |
a1(*t1)
bmethod_no_splat: |
s
bmethod_0_splat: |
s(*t0)
bmethod_1_splat: |
s(*t1)
bmethod_10_splat: |
s(*t10)
bmethod_100_splat: |
s(*t100)
bmethod_kw: |
b(kw: 1)
bmethod_no_kw: |
b
bmethod_kw_splat: |
b(**kw)
loop_count: 6000000
|