It's October once again, and that means it is time to take the new release of Python for a spin (technically, it is the 3.15.0rc3 release that I'm using, the official 3.15 release is still a few days…
It explains why a jit for Python, Ruby, JS & co that wants to produce performant code has to take advantage of the fact that programs are less dynamic that what each piece of code permits per language semantics – code doesn’t get run with new types/values/environment every time.
And yjit does in fact do this, via what they call lazy basic block versioning: When a basic block is is to be executed, yjit can produce a version of that block specialized for the types involved.
Sure, but GP wasn’t wondering “how would/does a JIT for Python/Ruby work?”, they’re wondering why Ruby’s JIT seems so much more successful than Python’s.
The thing is that Ruby is also rather dynamic, so that property alone can’t explain the disparity GP was wondering about.
score 1 · canonical
It explains why a jit for Python, Ruby, JS & co that wants to produce performant code has to take advantage of the fact that programs are less dynamic that what each piece of code permits per language semantics – code doesn’t get run with new types/values/environment every time.
And yjit does in fact do this, via what they call lazy basic block versioning: When a basic block is is to be executed, yjit can produce a version of that block specialized for the types involved.
score 1 · canonical
Sure, but GP wasn’t wondering “how would/does a JIT for Python/Ruby work?”, they’re wondering why Ruby’s JIT seems so much more successful than Python’s.
score 1 · canonical