-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RJIT #7448
RJIT #7448
Conversation
e37b624
to
bac3243
Compare
[Feature #19420]
Nice! Finally a JIT in a nice language^^ Do you have a link to the full list of commits/diff? -> it's already in the description :)
Could we just merge them at once (in the future) and let the notification system deal with it at its own pace? Regarding the Headline benchmarks, would you also have numbers with enough warmup for MJIT? Otherwise it's just showing MJIT takes longer to warmup but not comparing peak performance/how much it can optimize. |
Yeah, definitely. I may try that path next time.
I used your warmup harness and this was the medians that it printed (full details):
Also this was the last time I seriously benchmarked MJIT with enough warmup. At least on railsbench, I've only seen 1.02~1.05x speedup with MJIT at best, so RJIT will most likely be faster than MJIT regardless. |
Now I need to make TenderJIT outperform RJIT 🤣 |
Good news is that you've got a lot of new |
This is amazing. Wonderful work. The benchmark times include JIT overhead correct? Is there a graph of just the JIT overhead. What Ruby methods does RJIT rely heavily on and could they be sped up by RJIT? How does one use RJIT to make RJIT itself faster (lower latency). |
Full details are in https://gist.github.com/k0kubun/4e31fd289f8e3543dc094421eca90861. I haven't implemented a feature to render a graph to visualize the warmup performance, but you can see how it behaves on the 1st iteration, etc. |
full diff1: 55367b3...22d944c
Description
This PR replaces the current implementation of MJIT with a new JIT called "RJIT" 2.
See the ticket for motivation and further details: [Feature #19420]
Benchmark
I benchmarked the interpreter, YJIT, RJIT, and MJIT with yjit-bench.
Headline
RJIT's performance is still nowhere near YJIT's, but notably RJIT outperforms MJIT in all headline benchmarks, which are considered the most real-world workloads. RJIT gives a small speedup on railsbench even with yjit-bench's short warmup.
Other
Sometimes MJIT is still better than RJIT. However, RJIT outperforms both YJIT and MJIT on Optcarrot, which was the benchmark used for the Ruby 3x3 milestone.
Micro
30k_ifelse and 30k_methods are the things that YJIT is very good at, but RJIT outperforms YJIT on them. This seems to be because YJIT chose to interleave inline code and outlined code for Code GC and arm64's performance whereas RJIT doesn't do that. This is a good reminder of the code layout's impact.
Footnotes
I merged this branch in multiple batches because pushing hundreds of commits at once pressures our notification system a bit. However, an auto-format commit interrupted the operation, so I needed to resolve the conflict and this PR has only the diff after that commit. ↩
This PR doesn't rename the interface and internal names from MJIT to RJIT yet, but a separate PR will do that soon. ↩