Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Ruby is not the fastest language in the world, there is no doubt about it. This doesn't turn out to matter all that much – Ruby and its ecosystem has so much more to offer, making it a worthwhile tradeoff a lot of the times. However, you might occasionally encounter workloads that are simply not suitable for Ruby. This is especially true for frameworks like Rails, where the overhead wants to be as little as possible. In this talk, we will explore building a native Ruby extension with Rust to speed up parts of Rails. What does Rust have to offer here over plain-old C? Let's find out!
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 titled 'Turbo Rails with Rust' given by Godfrey Chan at RailsConf 2016, the speaker explores how incorporating Rust can enhance the performance of Ruby on Rails applications. While Ruby is appreciated for its usability and rich ecosystem, it is known to have performance limitations, especially in resource-intensive scenarios. Chan addresses building native Ruby extensions in Rust as a solution to optimize Rails performance, highlighting key features that Rust offers over traditional C programming. **Key Points Discussed:** - **Performance Limitations of Ruby:** Chan acknowledges that Ruby is slower compared to lower-level languages like C, but it provides significant benefits in developer experience and community support. - **Native Extensions:** The concept of native extensions is introduced, using the example of the 'json' gem, which uses both pure Ruby and C implementations to provide speed while maintaining a user-friendly API. - **FastBlank Example:** Chan discusses how the FastBlank gem reimplemented the `string.blank?` method in C, achieving significant performance improvements—demonstrating that developer experience can be preserved while enhancing performance through native extensions. - **Rust Advantages:** Chan presents Rust as a safer, modern alternative to C, discussing its memory safety without a garbage collector, compile-time error checks, and zero-cost abstractions. This reduces the risks associated with native extensions while ultimately achieving high performance. - **Helix Project:** Chan introduces a project called Helix, aimed at reducing boilerplate code needed for writing Rust extensions, making it easier for Ruby developers to use Rust without extensive knowledge of the language. - **Case Study – Meal Matching Algorithm:** The talk showcases a real-world use case from a catering company facing performance issues with a Ruby implementation of a meal matching algorithm. By re-implementing the algorithm in Rust, substantial performance improvements were observed, highlighting the practical benefits of using Rust for intensive computations. **Conclusions and Takeaways:** - Rust enables Rails developers to optimize performance-critical components without leaving the Ruby ecosystem, integrating seamlessly with existing Rails applications. - The safety and performance of Rust presents an appealing option for Ruby developers, particularly those facing computationally heavy tasks, while leveraging the community support from both languages. - The Helix project further aims to facilitate this integration, ensuring developers can continue to focus on Ruby while tapping into Rust's capabilities as needed.
Suggest modifications
Cancel