Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Dana Sherson Ruby sometimes has a reputation for being slow, but it doesn't have to be. There are likely ways to optimise fragments of your application and not even have to rewrite it in rust. Improve your intuition about bottlenecks and optimisations and how to use and read the output of tools like ruby-prof, rb-spy, benchmark, and others (including Dana's favourite: time), how to know what needs attention, and some surprising quirks when writing fast ruby. The title may seem like an exaggeration, but Dana did make a spell-checking ruby gem at least 300 times faster with the liberal application of benchmarking and profiling, and you can too. Dana has been programming in ruby for at least 10 years, and her ruby tattoo may prove she might like it a little too much. When not programming in ruby, Dana can be found failing at being a photographer, singing Avril Lavigne songs at karaoke, or adding unnecessary emoji to slack :yoda:. Dana has killed every plant that was ever in her care. Produced by NDV: https://youtube.com/channel/UCQ7dFBzZGlBvtU2hCecsBBg?sub_confirmation=1 #ruby #rubyconf #rubyconfau #rubyconf_au #rails #programming Fri Feb 21 16:00:00 2020 at Plenary Room
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 talk "300x Faster Ruby," Dana Sherson, a developer at Marketplace, shares insights into optimizing Ruby applications for speed without the need for extensive rewrites. She humorously acknowledges the clickbait nature of her title but promises a comprehensive examination of improving Ruby performance through practical techniques. Dana covers various key topics, including linting, design philosophy, and the development of a spell-checking gem, which she managed to enhance significantly. ### Key Points Discussed: - **Introductory Context**: Dana, with over a decade of Ruby programming experience, introduces her spell-checker project, highlighting the necessity for speed in development tools. - **Initial Challenge**: The spell-checker initially took 1 minute and 20 seconds for 30 files; through optimizations, she reduced this to several hundred milliseconds for the same task and just a few seconds for 6,000 files. - **Optimization Process**: - Write code iteratively, starting slowly to focus on correctness before improving speed. - Implement profiling using tools like `ruby-prof` and `rb-spy` to identify bottlenecks effectively. - Emphasize the importance of measuring performance before and after any optimization to avoid premature optimizations. - **Benchmarking Techniques**: Dana explains how to use Ruby’s built-in benchmarking to test and compare different methods, addressing the significance of testing various scenarios for accurate results. - **Algorithmic Improvements**: - Introduced the concept of binary searches for faster word checks in the spell-checker. - Discussed the impact of method choices, highlighting certain Ruby 2.4 and 2.7 enhancements. - **Efficient Practices**: - Minimize unnecessary file system interactions. - Cache results using memoization to avoid repeated computations. - Minimize the use of heavy features and unused libraries for simple scripts to enhance start-up speed. - **Parallel Processing**: Encouraged using parallel processing through the `parallel` gem while ensuring thread safety to manage complex operations more effectively. ### Examples Illustrated: - Dana provided specific instances from the development of her spell-checker where profiling yielded significant performance benefits. She shared the results of various benchmarking tests comparing different Ruby methods, including their effect on execution time. ### Conclusions and Takeaways: - Optimizing Ruby applications involves a structured approach of writing functionally correct code first, followed by profiling, benchmarking, and employing various strategies to reduce execution time. - Continuous measurement is vital to ensure optimizations yield tangible improvements while also embracing the iterative nature of development. - Ultimately, if conventional optimizations fall short, rewriting critical components in a faster language like Rust may be an alternative. Dana’s talk emphasizes that even though Ruby may have a reputation for being slow, with appropriate strategies and tools, significant performance improvements can be achieved while maintaining code integrity.
Suggest modifications
Cancel