Presumably it gives the JIT more type information, parent example was specifically about one of the type-check functions you can use for guards (is_float). While running it'll use the is_float information to generate code for the float case, and bail out if the actual values fail the guards at runtime.
Other JITS like V8 will do things like speculative inlining and inserting its own type guards , but if this JIT is "Admittedly an extremely simple one" then it presumably doesn't do much of that.
i ran a quick experiment where instead of doing boxing the way its done in the beam currently, i used a different boxing (NaN strategy and there was a 10x speedup
It's a JIT nowadays. Admittedly an extremely simple one, to minimize compile times and maintenance overhead.
You can get substantial performance improvements by using guards though. See what Wings3D does with is_float() everywhere in hot numeric-heavy code.
Can you elaborate why adding guards makes things faster?
Presumably it gives the JIT more type information, parent example was specifically about one of the type-check functions you can use for guards (is_float). While running it'll use the is_float information to generate code for the float case, and bail out if the actual values fail the guards at runtime.
Other JITS like V8 will do things like speculative inlining and inserting its own type guards , but if this JIT is "Admittedly an extremely simple one" then it presumably doesn't do much of that.
i ran a quick experiment where instead of doing boxing the way its done in the beam currently, i used a different boxing (NaN strategy and there was a 10x speedup
oh, I didn't recognize your username here! It's been ages since I've seen you. Hope you'll be in Chicago in September.
i will not, sorry. but ill probably be at exmex
Is that translates to real workloads you should open a pr.
Java and Javascript run times do really well at that.