We Turned Lobste.rs into a Rails Benchmark for YJIT

submited by
Style Pass
2023-09-15 02:00:11

We’re very proud of how well YJIT, the default JIT in CRuby, optimizes Rails apps. We’ve been using small Rails benchmarks for a couple of years. But as YJIT improves we need more data from real world apps to help us understand what will speed up Ruby the most. We turned the Lobsters codebase into a nice new benchmark. So how did we do that?

We create benchmarks and then we work to make YJIT good at them. You can see how YJIT speeds up over time on the same benchmark.

We write benchmarks, we measure benchmarks, and over time we fix YJIT problems that benchmarks show us. Thus does YJIT improve over time.

We have benchmarks for little pieces of Rails – Railsbench for a very simple one-resource application, and erubi-rails for testing view rendering in Erubi. They’re both quite small.

So we decided to add something bigger and more interesting. But not too interesting. With a gigantic benchmark, it can be hard to tell what’s causing any given trouble, and to understand the results.

Leave a Comment