Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Array and Hash are used in every Ruby program. Yet, current implementations either prevent the use of them in parallel (the global interpreter lock in MRI) or lack thread-safety guarantees (JRuby raises an exception on concurrent Array#). Concurrent::Array from concurrent-ruby is thread-safe but prevents parallel access. This talk shows a technique to make Array and Hash thread-safe while enabling parallel access, with no penalty on single-threaded performance. In short, we keep the most important thread-safety guarantees of the global lock while allowing Ruby to scale up to tens of cores! RubyKaigi 2018 https://rubykaigi.org/2018/presentations/eregontp
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
### Introduction The keynote presentation titled "Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby" by Benoit Daloze at RubyKaigi 2018 discusses crucial advancements in Ruby's performance, specifically emphasizing parallelism and thread safety achieved through the TruffleRuby implementation. ### Key Points - **TruffleRuby Overview**: - Developed by Oracle Labs, TruffleRuby is a high-performance Ruby implementation using the Graal Just-in-Time compiler. - It aims for full compatibility with CRuby and offers significant performance improvements over traditional Ruby implementations. - **Performance Metrics**: - The presenter showcases benchmarks comparing CRuby 2.0, MRI with the MG flag, and TruffleRuby. - Initial speeds of 28-30 frames per second with CRuby increase to around 170-200 frames per second with TruffleRuby after JIT compiler warm-up, demonstrating a remarkable performance leap. - **Ruby 3 Times 3 Project**: - Aiming to make Ruby 3 three times faster than CRuby 2.0, this includes various CPU benchmarks and TruffleRuby's performance achievements. - **Optimizations in TruffleRuby**: - TruffleRuby utilizes partial evaluation, optimizing how Ruby methods execute by transforming them into a compiler graph for efficiency. This results in optimized memory access and reduced overhead. - **Thread Safety and Parallel Access**: - Addressing Ruby's historical challenges with parallel execution, Benoit Daloze discusses methods developed to create thread-safe collections (Arrays and Hashes) that maintain performance and usability. - The implementation allows multiple threads to safely interact with mutable structures without exceptions or race conditions. - **Future Directions**: - Emphasis on continuing improvements in parallel execution ensuring that Ruby can take advantage of modern multi-core processors while preserving the dynamic language characteristics. ### Conclusion The keynote concludes with a strong vision for the Ruby ecosystem, focused on enhancing performance and integrating concurrency effectively. Daloze encourages ongoing discussion and community engagement to address challenges and leverage Ruby's full potential in concurrent environments. Overall, the session provides valuable insights into the advancements in Ruby implementation through TruffleRuby, emphasizing the need for high-speed, high-performance code that also upholds thread safety.
Suggest modifications
Cancel