Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
A talk from RubyConfTH 2023, held in Bangkok, Thailand on October 6-7, 2023. Find out more and register for updates for our next conference at https://rubyconfth.com/
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 'BYOJ: Build Your Own JIT with Ruby' presented by Syed Faraaz Ahmad at RubyConf TH 2023, the speaker explores the intricacies of Just-In-Time (JIT) compilation specifically within the Ruby programming language. The presentation provides an insightful overview of compilers and their two primary types: ahead-of-time and JIT. JIT compilers execute code while it runs, improving performance by compiling frequently called methods into machine code. The talk reviews historical approaches to Ruby's JIT implementation, including the MJIT and the advanced YJIT, introduced in Ruby 3.0 and refined in subsequent releases. Ahmad emphasizes the importance of understanding both physical and virtual machines in the context of Ruby. He explains how the Ruby VM, known as YARV (Yet Another Ruby VM), executes code by translating it into instruction sequences. By demonstrating a basic example involving a simple addition, he illustrates how stack manipulation occurs in Ruby and contrasts this with register-based machines, which optimize memory access. The session proceeds by delving into the specifics of creating a JIT compiler using ARJIT, a Ruby-based compiler that allows customization and ease of implementation. Ahmad walks the audience through important technical concepts such as instruction sequences, control frames, and the management of execution states, all pivotal for effectively navigating JIT building processes. Throughout the talk, key points include: - **Definition and Types of Compilers:** Overview of ahead-of-time vs. JIT compilers. - **Historical Path of Ruby's JIT:** MHIT introduced but lacking Rails compatibility, leading to YJIT development and optimizations. - **Machine Types:** Differences between stack-based (YARV) and register-based physical machines. - **Practical JIT Compilation Techniques:** Utilizing ARJIT to craft custom JIT compilers, including handling method returns and instruction sets. - **Performance Benchmarks:** Comparison of MJIT and YJIT showing significant performance improvements in Ruby applications. - **Potential Pitfalls in JIT Implementation:** Such as bugs leading to unexpected results (illustrated with the example of an erroneous '2 + 3' operation). In conclusion, Ahmad acknowledges the contributions of Takashi Kokubun, driving home the importance of collaborative learning in enhancing Ruby's capabilities. This talk serves as a comprehensive guide for developers looking to leverage JIT compilation to optimize their Ruby applications, showcasing practical methods to maximize performance while encouraging exploration of the JIT landscape.
Suggest modifications
Cancel