summaryrefslogtreecommitdiff
path: root/benchmark/mjit_exivar.yml
blob: e6fbae96ded127555db0c9fa5682c2ead974a248 (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
prelude: |
  class Bench < Hash
    def initialize
      @exivar = nil
    end

    def exivar
      @exivar
    end
  end

  bench = Bench.new

  if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
    jit_min_calls = 10000
    i = 0
    while i < jit_min_calls
      bench.exivar
      i += 1
    end
    RubyVM::MJIT.pause # compile (1)
    # issue recompile
    bench.exivar
    RubyVM::MJIT.resume
    RubyVM::MJIT.pause # compile (2)
  end

benchmark:
  mjit_exivar: bench.exivar

loop_count: 200000000