# Compiling Ruby To Machine Language

DevFeed: [Compiling Ruby To Machine Language](<https://devfeed.tech/articles/compiling-ruby-to-machine-language-31808.md>)

Original publisher: [Read original article](<https://patshaughnessy.net/2025/11/17/compiling-ruby-to-machine-language>)

Author: Pat Shaughnessy

Published: 2025-11-17T00:00:00Z

Content type: article

Language: en

Sources: [Pat Shaughnessy](<https://devfeed.tech/sources/pat-shaughnessy.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [JIT](<https://devfeed.tech/topics/jit.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [jit](<https://devfeed.tech/tags/jit.md>), [machine](<https://devfeed.tech/tags/machine.md>), [performance](<https://devfeed.tech/tags/performance.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [rust](<https://devfeed.tech/tags/rust.md>), [updating-ruby-under-a-microscope](<https://devfeed.tech/tags/updating-ruby-under-a-microscope.md>)

## AI overview

This excerpt explains how Ruby's YJIT compiler identifies frequently called functions and blocks, counts executions, and compiles hot YARV instruction sequences into machine language. It also describes thresholds used for small Ruby programs and Ruby on Rails web applications, along with YJIT blocks.

## Source excerpt

I've started working on a new edition of Ruby Under a Microscope that covers Ruby 3.x. I'm working on this in my spare time, so it will take a while. Leave a comment or drop me a line and I'll email you when it's finished. Here's an excerpt