←
Roman Samoilov | Rage107 posts
Roman Samoilov | Rage avatar

Roman Samoilov | Rage

@codewithrage

Fiber-based framework for teams that love Ruby but need fewer reasons to explain why they’re still using it.

◷ Joined January 2026▧ 20 Photos and videos
Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jan 20

Why is Ruby losing ground? It's not because the language is "dead" - it's because our tools haven't evolved to meet modern performance and stability needs. I built Rage to give Ruby teams the missing pieces they've been looking for in other ecosystems. A thread on the mission behind Rage:

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Oct 8

Just reproduced the official Basecamp’s Pi benchmark with Rage. Rage replaced Rails+Puma+Resque+Redis, handled 10x clients, with ~22x the deliveries per second and ~4x less memory per connection.

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jul 31

The most common piece of feedback I got about Rage? “API-only sucks.” So I shipped the official Inertia.js adapter. Auto-starts Vite in dev, pre-builds assets for prod, exposes Inertia props out of the box. What’s your next excuse?

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jul 9

Rage just got daemons. Rage::Daemon lets you run long-lived background processes alongside your app. No external process managers needed. The processes your app depends on now have a home inside the app, supervised by the framework.

Post attachment
Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

Benchmarks across a full request cycle - request in, connection pool, database query - show the 2.2x to 4x improvement. In 30 lines of code. Simplicity-driven development wins again.

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

Looking back at the previous example, if 1000 fibers try to fetch a connection from an empty pool, each new timer will be `Time. now + 5` - i.e. higher than the previous one. Which means that if we first check the last element in the list before doing the O(N) insertion, we can get constant-time insertions in the most common scenario.

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

As with any type of refactoring, the most vital prerequisite for performance optimisations is understanding your system. What do we know about timers in Ruby? Usually, they are uniform.

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

Skip lists power sorted sets in Redis, which is what I used as a reference for a draft implementation. The changes required were quite substantial though, which is why I was putting it off. But the PRs got me wondering - can I make it simpler?

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

The optimisation I wanted to implement would use a skip list - a (fascinating, as everything randomised if you ask me) data structure that uses a combination of multiple sparse linked lists and randomness to bring insertion time into sorted linked lists from O(N) down to O(log N)

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

For example, if there’re no connections left in the pool, Rage will pause the fiber until either a connection appears in the pool or 5 seconds pass - that’s our timer!

Post attachment
Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

When a fiber needs to pause for a specific amount of time, Rage puts that information into a sorted linked list. The list has to be sorted so that the first element always represents the fiber that has to be woken up the soonest.

Roman Samoilov | Rage avatar
Roman Samoilov | Rage@codewithrage·Jun 9

For several months, I wanted to optimise the code in Rage that schedules fibers to be woken up at a specific time. The plan was to use skip lists. Last week, @maciejmensfeld’s compilation of Ruby performance PRs got me inspired, and I decided to give it another look 🧵