Live data from Hacker News

ZJIT removes redundant object loads and stores

railsatscale.com

11–20 of 22 posts

Re: ZJIT removes redundant object loads and stores

#11
post #5

for me is more interesting that Maxime Chevalier-Boisvert left shopify and is doing other stuff, who will carry on with zjit

You got your reply already. To add: YJIT is the one that does "basic block versioning" (Which was Maxime's thesis) while ZJIT is a more traditional design.

I am confident in that description but don't actually know what it means in practice (yes I've seen papers and talks, but I kinda need not-compiler-engineer to explain it to me.)

As I understand it BBV still holds promise, but the sheer volume of knowledge of more traditional methods might mean it gets better outcomes (also IIRC ZJIT is still lagging YJIT).

Re: ZJIT removes redundant object loads and stores

#12
post #5

for me is more interesting that Maxime Chevalier-Boisvert left shopify and is doing other stuff, who will carry on with zjit

You got your reply already. To add: YJIT is the one that does "basic block versioning" (Which was Maxime's thesis) while ZJIT is a more traditional design. I am confident in that description but don't actually know what it means in practice (yes I've seen papers and talks, but I kinda need not-compiler-engineer to explain it to me.) As I understand it BBV still holds promise, but the sheer volume of knowledge of more…

> IIRC ZJIT is still lagging YJIT

It would be nice to have ZJIT on speed.ruby-lang.org!

Re: ZJIT removes redundant object loads and stores

#13
post #5

for me is more interesting that Maxime Chevalier-Boisvert left shopify and is doing other stuff, who will carry on with zjit

You got your reply already. To add: YJIT is the one that does "basic block versioning" (Which was Maxime's thesis) while ZJIT is a more traditional design. I am confident in that description but don't actually know what it means in practice (yes I've seen papers and talks, but I kinda need not-compiler-engineer to explain it to me.) As I understand it BBV still holds promise, but the sheer volume of knowledge of more…

I gave a talk about ZJIT and the motivation for the change at RubyKaigi 2025 if people are curious. It's on YouTube.

Re: ZJIT removes redundant object loads and stores

#15

Earlier quoted context omitted.

You got your reply already. To add: YJIT is the one that does "basic block versioning" (Which was Maxime's thesis) while ZJIT is a more traditional design. I am confident in that description but don't actually know what it means in practice (yes I've seen papers and talks, but I kinda need not-compiler-engineer to explain it to me.) As I understand it BBV still holds promise, but the sheer volume of knowledge of more…

I gave a talk about ZJIT and the motivation for the change at RubyKaigi 2025 if people are curious. It's on YouTube.

https://www.youtube.com/watch?v=1CCDuRW0OLk

Re: ZJIT removes redundant object loads and stores

#17

I'm working on an interpreter right now, and I'm considering adding JIT support in the future. Are there other blog posts like this, or deep dives that talk about how to implement and tune a JIT?

I used asmjit to implement JIT compilation. Highly recommend it.

Maybe you'll find the resources I link to in the documentation for my project helpful.

https://github.com/ZQuestClassic/ZQuestClassic/blob/main/doc...

Or perhaps you'd find reviewing my usage of asmjit helpful:

https://github.com/ZQuestClassic/ZQuestClassic/blob/main/src...

My main high-level advice would be to have an extensive set of behavioral tests (lots of scripts with assertions on the output). This helps ensure correctness when you flip on your JIT compilation.

You'll eventually run into hard to diagnose bugs - so be able to conditionally JIT parts of your code (per-function control - or even better, per-basic block) to help narrow down problem areas.

The other debugging trick I did was spit out the full state of the runtime after every instruction, and ensure that the same state is seen after every instruction even w/ JIT enabled.

Good luck!

Post reply on HN