Ruby Video
Talks
Speakers
Events
Topics
Leaderboard
Sign in
Talks
Speakers
Events
Topics
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf 2018 - The secret power of Ruby 2.6: JIT by Takashi Kokubun Have you tried the JIT compiler included in Ruby 2.6 preview releases? It's easy, just include "--jit" option to a ruby command or set RUBYOPT="--jit" environment variable. You've just learned how to enable it. But wait, are you sure you can use it? What the hell is going on behind it, why is there a GCC process under your Ruby process, and why can JIT even make your Ruby program even slower? In this talk, you'll be prepared to try the brand-new Ruby's secret power on production from the next Christmas.
Date
Summary
Markdown supported
The video titled "The Secret Power of Ruby 2.6: JIT" presented by Takashi Kokubun at RubyConf 2018 discusses the newly integrated Just-In-Time (JIT) compiler in Ruby 2.6, highlighting its potential for performance enhancement and caveats related to its experimental nature. Takashi Kokubun, a contributor to Ruby development, shares his expertise on optimizing Ruby code through JIT compilation. Key points covered in the talk include: - **Background of JIT**: JIT stands for Just-In-Time compilation, which has recently been introduced to improve Ruby's performance starting with Ruby 2.6. - **Historical Context**: The presentation provides a brief history of Ruby's performance evolution, emphasizing how earlier versions utilized tree structures for code parsing, moving to a more efficient approach with the introduction of the Ruby virtual machine. - **JIT Compiler Functionality**: The JIT compiler translates Ruby code into native machine code, simplifying execution and dramatically increasing speed. For instance, benchmarks like ‘optcarrot’ demonstrate significant performance upgrades, achieving results significantly faster than Ruby 2.5. - **Optimization Usage**: The JIT compiler is not enabled by default; developers need to use specific command-line arguments or set environment variables to utilize it effectively. - **Performance Challenges**: While powerful, the JIT compiler presents certain challenges, such as - **Memory Limitations**: The JIT can slow down Ruby when it faces numerous methods due to caching constraints. With a limit of 1000 cached methods, performance can degrade in resource-heavy environments. - **Resource Pressure**: Server systems with constrained resources, when paired with active JIT compilation, may experience performance degradation, particularly with concurrent processes. - **Trace Points Impact**: Using trace points can negatively impact performance, as they introduce overhead during debugging. - **Multiple Method Invocation**: Simultaneously optimizing many methods can stress the internals of the JIT, causing substantial slowdowns. - **Handling Internal Exceptions**: Too many processes requiring JIT can lead to memory management issues. - **Conclusion**: While the JIT compiler can greatly enhance Ruby's performance, its deployment should be approached with caution. Developers are encouraged to monitor their applications and utilize benchmarking tools to identify bottlenecks or performance issues. The ongoing development will aim to refine JIT, increasing its efficacy in production settings, underscoring the importance of community feedback in this iterative process. This informative session wraps up with an invitation for questions, furthering the dialogue about Ruby's JIT capabilities and optimizations post-Ruby 2.6 release.
Suggest modifications
Cancel