mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add a benchmark for JIT-ed code dispatch
This commit is contained in:
parent
e006b992c2
commit
b414999370
1 changed files with 46 additions and 0 deletions
46
benchmark/mjit_exec.yml
Normal file
46
benchmark/mjit_exec.yml
Normal file
|
@ -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
|
Loading…
Reference in a new issue