2 ms·
> the C code is still going to be waaay faster than the Ruby code even with YJIT. I can't find it but I remember seeing a talk where they showed examples of Ru
by Alifatisk 2y ago
> the C code is still going to be waaay faster than the Ruby code even with YJIT.
I can't find it but I remember seeing a talk where they showed examples of Ruby + YJIT hitting the same speed and in some cases a bit more than C. The downside was though that it required to some warmup time.
- IshKebab 2y agoI find that hard to believe. I've heard claims JIT can beat C for years, but they usually involve highly artificial microbenchmarks (like Fibonacci) and even for a high performance JITed language like Java it ends up not beating C. There's no way YJIT will. The YJIT website itself only claims it is around twice as fast as Ruby, which means it is still slower than a flat earth snail. The benchmarks game has YJIT and it's somewhere between PHP and Python. Very slow.
- Alifatisk 2y agoI’ll see if I can find the presentation again on Youtube
- igouy 2y agoMaybe "Ruby Outperforms C" was bait for "Outperforming a C extension" which is about the relative cost of calling C from Ruby? https://railsatscale.com/2023-08-29-ruby-outperforms-c/ https://railsatscale.com/2023-08-29-ruby-outperforms-c/