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 by statically analyzing dependencies in our codebase to drive an autoloader.
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 this talk presented at GoRuCo 2017, Andrew Metcalf addresses the challenge of improving the loading times of large Ruby applications, particularly within Stripe's monorepo, which encompasses millions of lines of code. He explains the fundamental issue developers face: long reload times, which previously ranged from 30 to 35 seconds, frustrating productivity. The solution developed involved creating an autoloader that statically analyzes code dependencies to optimize the loading process. **Key Points Discussed:** - **Monorepo Challenges:** Stripe's product code is housed in a single monorepo, leading to tightly coupled components that necessitate loading all components even when only a few are needed. - **Comparison of Languages:** Through synthetic benchmarks, Metcalf identified Ruby as slow in loading times compared to Python and JavaScript, which employ caching and more efficient loading strategies. - **Development of an Autoloader:** The project aimed to develop an autoloader that generates stubs for quicker reference without requiring extensive 'require_relative' statements. This process involves analyzing the codebase into an Abstract Syntax Tree (AST) to resolve definitions and references efficiently. - **Efficiency Gains:** The autoloader transformed the loading process from 35 seconds to just 5 seconds. This involved determining only necessary components for loading, thus condensing the overall process. - **Handling Edge Cases:** Various strategies were employed to manage edge cases, ensuring stability across the codebase during transition to the new loading system. - **Future Aspirations:** Metcalf discusses ambitions to optimize dependency resolution times further and consider type-checking as a means of enhancing static analysis capabilities. In conclusion, enhancing the boot times of Ruby applications at Stripe involves not only optimizing loading processes but also encourages developers to refactor their code for better modularity and efficiency. The overarching takeaway is that the answers to improving performance may lie in streamlining code and enhancing organizational clarity within the existing framework.
Suggest modifications
Cancel