Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
TruffleRuby together with Truffle Regex can now execute Ruby Regexps up to 40 times faster than CRuby! This is possible by just-in-time compiling Ruby Regexps to machine code by using Truffle Regex, a Truffle language for regular expressions. Truffle Regex uses finite-state machines, a much faster alternative to backtracking regexp engines. Because of the unique capability of GraalVM to inline across languages, the Ruby code and the Regexp are optimized and compiled together for ultimate performance.
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 video from RubyConf 2021, speaker Maxime Chevalier Boisvert presents the development of YJIT, a Just-In-Time compiler for CRuby. The talk covers the necessity of YJIT in enhancing the performance of Ruby applications, particularly web workloads such as Ruby on Rails, which are prevalent at Shopify where the project originated. Key points include: - **Definitions and Context**: YJIT stands for Yet Another Ruby Just-In-Time compiler. It was developed to address the performance limitations of previous JIT projects, aiming for compatibility with existing Ruby code while incrementally enhancing performance. - **Development Approach**: The development of YJIT is led by an open-source initiative at Shopify. The team emphasizes backward compatibility with existing Ruby features, ensuring that most Ruby code runs unmodified. - **Technical Challenges**: The speaker explains the inherent difficulties in optimizing Ruby due to its dynamic typing, method dispatch complexities, and the potential for redefining core operators. These aspects introduce multiple path-checks that complicate code generation. - **Lazy Basic Block Versioning**: Utilizing this technique developed during Boisvert's PhD research, YJIT compiles only the frequently executed parts of methods, allowing for efficient specialization of types at runtime. This avoids the pitfalls of whole-program analysis, facilitating faster compilation and reduced code size. - **Performance Benchmarks**: YJIT demonstrates significant speed improvements over the Ruby interpreter and shows better performance than other JIT compilers like MJIT on real-world benchmarks, particularly those related to web applications. Reports suggest speedups ranging between 5% to 30%, with ongoing development aimed at improving this further. - **Future Plans**: The speaker discusses upcoming features and improvements, including plans to optimize ERB template rendering, inlining, a garbage collector for code, and broader platform support. In conclusion, while still in its early stages, YJIT shows promise for enhancing Ruby’s performance in web applications with a compatible design philosophy. The project aims to undergo further developments, aiming for integration into future Ruby releases and addressing existing limitations and performance bottlenecks. Boisvert invites the community to engage with and test YJIT as it evolves, ensuring a vibrant collaborative development process that retains Ruby's invaluable characteristics while boosting performance.
Suggest modifications
Cancel