Optimizing Ruby Path Methods

One tiny Ruby speed hack, huge time savings — and the comments ask if Ruby’s even alive

TLDR: Intercom’s engineer trimmed Ruby startup time, multiplying savings across 1,350 parallel test runs. The comments exploded into a “Is Ruby dead?” roast, a push to put the optimization into Ruby itself, and cheers for a reported 7x speedup—proof that tiny tweaks can mean big money for big teams.

Intercom’s new engineer went full pit-crew on their test system, shaving seconds off the time it takes to start Ruby before tests run. Why it matters: they spin up 1,350 workers at once, so saving a single second saves over 20 minutes of compute per build. The trick? Smarter file-loading during startup using the long-standard Rails helper Bootsnap. Translation for non-coders: it makes Ruby find files faster so everything boots quicker.

But the code wasn’t the hottest thing here — the comments were. One joker kicked off with, “people still use Ruby?”, reigniting the eternal “Is Ruby dead?” meme. Performance nerds fired back: this is real money and time saved. Another commenter asked if this should be baked into Ruby itself, essentially yelling, “Ship it upstream!” Meanwhile, a crafty engineer suggested using the project’s Git info to decide when to refresh the cache, turning a speed hack into a smarter speed hack.

Fan energy peaked with praise for a reported 7x faster path-joining trick, hailing the author as a low-level wizard. TL;DR: half the thread was snark, half was engineering excitement — all of it was popcorn-worthy. Ruby may be “old,” but when it starts this fast, it’s hard to call it dead.

Key Points

  • CI has a fixed setup phase (code fetch, service prep, app boot) that all workers must complete, limiting parallelization gains.
  • Intercom’s CI runs 1,350 workers by default, so reducing setup time has large cumulative impact (over 20 minutes of compute saved per second).
  • A 1-hour test suite with a 1-minute setup illustrates diminishing returns as parallelism increases due to per-worker setup costs.
  • The author targeted setup-time reductions alongside test/factory speedups to improve user experience and reduce compute cost.
  • Ruby’s require performs a linear search over $LOAD_PATH; as load paths and required features grow, boot-time cost scales roughly O(N*M), motivating optimizations like Bootsnap.

Hottest takes

"people still use ruby?" — blinkbat
"check for a .git and use the git tree to invalidate the cache" — vidarh
"A 7x improvement… Thank you, byroot!" — somewhatrandom9
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.