From b4149993709169b9a67373095593da385e7d48e5 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 21 Sep 2019 16:09:45 +0900 Subject: [PATCH] Add a benchmark for JIT-ed code dispatch --- benchmark/mjit_exec.yml | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 benchmark/mjit_exec.yml diff --git a/benchmark/mjit_exec.yml b/benchmark/mjit_exec.yml new file mode 100644 index 0000000000..d2621888f2 --- /dev/null +++ b/benchmark/mjit_exec.yml @@ -0,0 +1,46 @@ +prelude: | + # to be used with: --disable-gems --jit-min-calls=2 + def compile(call) + eval(<<~EOS) + #{call}; #{call} + if RubyVM::MJIT.enabled? + RubyVM::MJIT.pause(wait: true) + end + EOS + end +benchmark: + - name: "mjit_exec_iseq_vme_jit " + prelude: | + def jit() end + compile('jit') + script: jit + - name: mjit_exec_iseq_vme_jit_jit + prelude: | + def jit2() end + def jit() jit2() end + compile('jit') + script: jit + - name: mjit_exec_iseq_vme_jit_vme + prelude: | + def jit2() rescue; end + def jit() jit2() end + compile('jit') + script: jit + - name: "mjit_exec_send_vme_jit " + prelude: | + def jit() end + compile('send(:jit)') + script: send(:jit) + - name: mjit_exec_send_vme_jit_jit + prelude: | + def jit2() end + def jit() send(:jit2) end + compile('send(:jit)') + script: send(:jit) + - name: mjit_exec_send_vme_jit_vme + prelude: | + def jit2() rescue; end + def jit() send(:jit2) end + compile('send(:jit)') + script: send(:jit) +loop_count: 30000000