aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark/vm_call_send_iseq.yml
blob: 60ff23c475a49fd02ad0a7035be99a34c5b59fb4 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
prelude: |
  def a0; end
  def a1(a) a; end
  def s(*a) a; end
  def b(kw: 1) kw end
  def sb(*a, kw: 1) kw end

  t0 = 0.times.to_a
  t1 = 1.times.to_a
  t10 = 10.times.to_a
  t200 = 200.times.to_a

  a0_t0 = [:a0, *t0]
  a1_t1 = [:a1, *t1]
  s_t0 = [:s, *t0]
  s_t1 = [:s, *t1]
  s_t10 = [:s, *t10]
  s_t200 = [:s, *t200]
  sb_t0 = [:sb, *t0]
  sb_t1 = [:sb, *t1]
  sb_t10 = [:sb, *t10]
  sb_t200 = [:sb, *t200]
  kw = {kw: 2}
benchmark:
  send_simple_0: |
    send(:a0)
  send_simple_1: |
    send(:a1, 1)
  send_simple_0_splat: |
    send(:a0, *t0)
  send_simple_1_splat: |
    send(:a1, *t1)
  send_simple_0_splat_comb: |
    send(*a0_t0)
  send_simple_1_splat_comb: |
    send(*a1_t1)
  send_no_splat: |
    send(:s)
  send_0_splat: |
    send(:s, *t0)
  send_1_splat: |
    send(:s, *t1)
  send_10_splat: |
    send(:s, *t10)
  send_200_splat: |
    send(:s, *t200)
  send_0_splat_comb: |
    send(*s_t0)
  send_1_splat_comb: |
    send(*s_t1)
  send_10_splat_comb: |
    send(*s_t10)
  send_200_splat_comb: |
    send(*s_t200)
  send_kw: |
    send(:b, kw: 1)
  send_no_kw: |
    send(:b)
  send_kw_splat: |
    send(:b, **kw)
  send_0_splat_kw: |
    send(:sb, *t0, **kw)
  send_1_splat_kw: |
    send(:sb, *t1, **kw)
  send_10_splat_kw: |
    send(:sb, *t10, **kw)
  send_200_splat_kw: |
    send(:sb, *t200, **kw)
  send_0_splat_comb_kw: |
    send(*sb_t0, **kw)
  send_1_splat_comb_kw: |
    send(*sb_t1, **kw)
  send_10_splat_comb_kw: |
    send(*sb_t10, **kw)
  send_200_splat_comb_kw: |
    send(*sb_t200, **kw)
loop_count: 3000000