- Ruby path fix cuts setup 60 seconds to under 1 second on 1350 workers.
- Saves 20 compute minutes per CI build at Intercom.
- 1-hour test suite runs in 1 minute on 60 workers.
Intercom engineer Matijs de Jong optimized Ruby's $LOAD_PATH on April 18, 2024. The change reduces continuous integration setup time from 60 seconds to under one second across 1,350 parallel workers, per de Jong's blog post.
Each worker saves 59 seconds per build. Total savings reach 22.5 compute minutes per run.
Ruby Path Loading Inefficiencies
Ruby scans directories for each require. Gems append paths to $LOAD_PATH, triggering rescans. Aaron Patterson, Ruby core team member, noted this at GORUCO 2015.
Intercom's monolith loads thousands of dependencies via Bundler. Pre-optimization, workers averaged 60 seconds on path setup, de Jong measured.
Bundler lists directories repeatedly. Patterson recommended caching to avoid duplication.
De Jong's Path Deduplication Fix
De Jong added deduplication at boot. Ruby caches unique paths once, per his benchmarks.
A one-hour test suite completed in 15 minutes on four workers, six minutes on 10 workers, and one minute on 60 workers post-optimization.
Intercom tested on its CI fleet. Setup times fell below one second.
Prior Tools: Bootscale and Bootsnap
De Jong authored bootscale at Shopify. It preloads paths for monoliths. Source code is on GitHub.
Burke Libbey, Shopify engineer, created Bootsnap. It caches require paths for Rails. Shopify uses it for fast boots.
Intercom combined these for CI.
Intercom CI Scale and Savings
Intercom uses 1,350 parallel workers. Savings total 22.5 compute minutes per build.
De Jong estimates 20 minutes saved per engineer per build. Faster CI shortens feedback loops.
Cost Reductions on AWS
At USD 0.10 per vCPU-minute on AWS EC2, savings are USD 2.25 per build across 1,350 workers, per de Jong's calculations and AWS pricing.
With 10 builds daily by 50 engineers, daily savings hit USD 1,125. Annual total exceeds USD 400,000.
Impact on AI Deployments
Faster boots reduce cold starts in Kubernetes for Rails-based AI APIs. Intercom reallocates savings to GPU clusters.
Future: Rails 8 and Ruby 3.4
Rails 8 adds path caching, per Rails performance guides.
Ruby 3.4 tests frozen $LOAD_PATH for further gains. Intercom's work sets a benchmark for monoliths.
Frequently Asked Questions
What is Ruby path optimization?
Deduplicates $LOAD_PATH early in boot to skip redundant scans. Intercom engineer Matijs de Jong cut setup from 60 seconds to under one second.
How does it improve AI model deployment?
Reduces cold starts in Kubernetes for Rails APIs serving AI models. Saves 20 compute minutes per build on 1350 workers.
Why use bootsnap in startups?
Caches paths for fast requires in Rails apps. Shopify engineer Burke Libbey developed it for production monoliths.



