Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
How to load 1m lines of Ruby in 5s by Andrew Metcalf Applications written in Ruby, Python and several other popular dynamic languages become very slow to boot as they grow to millions of lines of code. Waiting to reload code in development becomes a major frustration and drain on productivity. This talk will discuss how we reduced the time to boot a service at Stripe from 35s to 5s and the static analysis tools we built along the way.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the video titled "How to load 1m lines of Ruby in 5s," Andrew Metcalf discusses the challenges his team at Stripe faced in managing a large codebase composed of millions of lines of Ruby code. The primary concern was the sluggish boot time of applications as the codebase grew, which extended from 35 seconds to over 5 seconds with efficient improvements. Metcalf highlights several key points during his talk: - **Development Environment**: He explains the structure of Stripe's codebase, emphasizing its monolithic nature and the reliance on Sinatra instead of Rails, which prompted the need for rapid development cycles. - **Initial Problems**: He explores the issues surrounding code reloading, noting that any modifications could necessitate a complete reload of the entire codebase, leading to frustrating delays in the development loop. - **Static Analysis Tools**: To address these inefficiencies, the team implemented an autoloader system that could intelligently load only the necessary components of the application instead of the entire codebase. - **Autoloader Explanation**: Metcalf dives into specific techniques used to improve loading times, including static analysis of the codebase using Ruby's parser gem, allowing them to create a definition tree that keeps track of module dependencies. - **Complexity and Solutions**: He details the time-saving measures of converting dynamic requires into static references, thus resolving errors more efficiently and minimizing the need for complex dynamic loading structures. - **Dependency Management**: The team developed comprehensive mapping of code dependencies which enhanced their CI framework, allowing selective test execution based on changes made. - **Future Improvements**: Metcalf concludes with ambitions to integrate type-checking mechanisms into Ruby code for greater structure and stability. The ultimate takeaway is that optimizing Ruby loading times is not merely about speed enhancements but involves architecting a modular codebase and streamlining loading processes for better development experience. This presentation was shared during RubyConf 2017, aimed at providing solutions to boot time issues faced across large Ruby applications.
Suggest modifications
Cancel