How to Write Fast Code in Ruby on Rails - Shopify
Oct 8, 2019

Summary
This post details strategies for writing faster code in Ruby on Rails, focusing on Active Record performance (lazy evaluation, selecting fewer columns, avoiding query cache, indexing), Rails performance (caching, throttling, background jobs, dependency management), and Ruby performance (sparing use of metaprogramming, understanding O(n) vs O(1) complexity, minimizing object allocations). It provides specific code examples and references tools like LHM, rack-attack, Sidekiq, and benchmark-ips.
More from the React Native App Clip Development trail
- Helix: The internal tool powering our Shopify app's native migration (2026) - Shopify
- Native is now the future of mobile at Shopify (2026) - Shopify
- Migrating Shop app from React Native to native (2026) - Shopify
- Migrating to React Native's New Architecture (2025) - Shopify
- Five years of React Native at Shopify (2025) - Shopify