summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-09-21 16:09:45 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-09-21 16:09:52 +0900
commitb4149993709169b9a67373095593da385e7d48e5 (patch)
tree38a7497798d85d6a065efcf8289588481d0baeeb /benchmark
parente006b992c29decb01865b0749e35a4cfc872bdaf (diff)
Add a benchmark for JIT-ed code dispatch
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/mjit_exec.yml46
1 files changed, 46 insertions, 0 deletions
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