Performance Optimization Guide
Learn how to optimize Rad for maximum performance in your Ruby projects.
Performance Comparison
Rad is designed from the ground up for speed. Compared to traditional Ruby dependency managers, Rad is typically 3-8× faster for cold cache operations, and continues to outperform with warm caches.
Project Size | Gem Count | Cold Install (Rad) | Warm Install (Rad) | Cold Install (Bundler) | Improvement |
---|---|---|---|---|---|
Small | 9 | 1.94s | 0.59s | 7.33s | ~3.8x faster |
Medium | 20 | 2.26s | 0.61s | 15.71s | ~7.0x faster |
Large | 45 | 6.30s | 2.53s | 52.40s | ~8.3x faster |
Tests performed on an Apple M2 Pro with Ruby 3.2. Small project: 9 gems (sinatra, sqlite3, puma, faker, etc.). Medium project: 20 gems (Rails, sqlite3, sidekiq, devise, etc.). Large project: 45 gems (Rails, sqlite3, sidekiq, devise, aws-sdk-s3, graphql, etc.).
Large Project Installation Time (smaller is better)
Installing a large project (45 gems) on an Apple M2 Pro with Ruby 3.2 using a cold cache.
Lazy Loading Optimization
Rad uses an advanced lazy loading approach for gem metadata, which significantly reduces network traffic, memory usage, and speeds up resolution.
How Lazy Loading Works
Rad implements a two-step fetching process that only downloads the metadata you actually need:
- Reduced network traffic by 30-40%
- Lower memory usage by 20-30%
- Faster resolution speed by 10-20%
- Smart error handling with automatic retries and exponential backoff
Configuring Lazy Loading
Lazy loading is enabled by default, but you can configure it using environment variables or command-line flags:
Caching Strategies
One of the most effective ways to improve performance is to properly utilize Rad's caching mechanisms.
Cache TTL Configuration
Configure how long cached data remains valid:
Platform Caching
Enable platform compatibility caching for larger projects:
Platform Optimization
Rad can significantly improve performance with its advanced platform detection capabilities.
Platform Detection
Platform Compatibility Check
Memory Usage Optimization
Rad is designed to be memory efficient, typically using a fraction of the memory that Bundler requires.
Execution Speed Optimization
Rad's exec command runs commands with project gems loaded significantly faster than bundle exec:
CI Optimization
In CI environments, these techniques will produce the fastest builds:
Best Practices Checklist
- Keep lazy loading enabled (it's on by default)
- Use platform caching for large projects
- Set appropriate cache TTL for your environment
- Only install the platforms you need
- Utilize Rad's memory-efficient resolver
- Implement proper CI caching for faster builds
- Use rad exec instead of bundle exec for faster command execution
Coming Soon: Even More Optimizations
The Rad team is continuously working on performance improvements, including algorithm enhancements, more efficient memory usage, and parallel gem fetching capabilities.