RubyKaigi 2024 https://rubykaigi.org/2024/
![YJIT Makes Rails 1.7x faster / RubyKaigi 2024](https://cdn-ak-scissors.b.st-hatena.com/image/square/df568cc17b01d321b7b74ae848ef8e0bb0962da1/height=288;version=1;width=512/https%3A%2F%2Ffiles.speakerdeck.com%2Fpresentations%2Fcd4530c0dcd64046a03bb43045487d41%2Fslide_0.jpg%3F30119502)
Sometimes, I don’t know why I do things. It’s one of these times. A few months ago, Python 3.13 got its JIT engine, built with a new JIT compiler construction methodology (copy-patch, cf. research paper). After reading the paper, I was sold and I just had to try it with PostgreSQL. And what a fun ride it’s been so far. This blog post will not cover everything, and I prefer other communication meth
次期Python、ついにJITコンパイラ搭載の見通し。「copy-and-patch」と呼ばれる新たなJITコンパイラの仕組みとは? 機械学習やAI処理の分野を中心に非常に高い人気のプログラミング言語である「Python」の次期バージョンに、処理速度の向上を目指したJITコンパイラが搭載される見通しです。 このJITコンパイラは、PythonコアデベロッパーのBrandt Bucher氏が提案し、実装しています。 そしてPython Software FoundationのフェローであるAnthony Shaw氏がブログ「Python 3.13 gets a JIT」で、このJITコンパイラについて解説しています。 これらの情報を元に、PythonのJITコンパイラがどのように実装されようとしているのか、少し紹介していきましょう。 RubyもJavaScriptもJITが高速化を実現してき
Ruby 3.3リリース! 新機能解説 Ruby 3.3 YJITのメモリ管理とRJIT 〜すべてが新しくなった2つのJITを使いこなす 2023年12月25日、Ruby 3.3.0がリリースされ、様々な新機能が加えられました。本連載では実際に携わった皆さんにその新しいRubyをご紹介いただきます。 RubyはJust-In-Time(JIT)コンパイラという機能を備えており、これを有効化すると実行時に機械語を生成して様々な最適化が行なわれ、実行が高速になります。Ruby 3.3にはYJITとRJITという2つのJITコンパイラがあり、デフォルトでは無効になっていますが、それぞれ--yjitと--rjitで有効化できます。 この回では、Ruby 3.3でYJITの性能特性が変化した点や、YJITに新たに追加された便利な機能、またRJITはどのように使うものであるかについて解説します。 YJ
Happy New Year everyone! In late December 2023 (Christmas Day to be precise), CPython core developer Brandt Bucher submitted a little pull-request to the Python 3.13 branch adding a JIT compiler. This change, once accepted would be one of the biggest changes to the CPython Interpreter since the Specializing Adaptive Interpreter added in Python 3.11 (which was also from Brandt along with Mark Shann
This year, the YJIT team has been working hard to improve and optimize YJIT. We’re proud to say that the version of YJIT to be included with Ruby 3.3 is leaps and bounds ahead of Ruby 3.2’s. It provides better performance across the board, while also warming up faster and using less memory. The 3.3 release is also more robust, including a number of bug fixes along with an improved test suite. In t
I am a GCC compiler engineer, and for the past 15 years, I have primarily focused on the GCC register allocator and instruction scheduler. The major development of the GCC register allocator and instruction scheduler was completed quite some time ago, and these days, my main responsibility is maintaining these essential GCC components. About six years ago, I began dedicating half of my work time t
RubyKaigi 2023でRuby JIT Hacking Guideというタイトルで発表してきた。 speakerdeck.com JITコンパイラを書くチュートリアル 今回の発表ではJITコンパイラが書ける人間を増やすことをゴールにしていたが、 30分という短い発表枠内では雰囲気を知ってもらうことにフォーカスし、 実際に手を動かしたい人たちにはそれ用のチュートリアルを触ってもらう形を取った。 github.com JITコンパイラは実は初心者向き 独学でコンパイラの作り方を学ぶ人は、Cコンパイラなどを実装することが多いように思う。 C言語は実装対象として一見シンプルそうに見えて実は結構機能が多いので、C11をゴールに始めてもC89の範囲すら実装しきらないままエターなる人も多いのではないか。 そんな僕みたいな堕落した人間にお勧めなのがJITコンパイラ。 インタプリタと併走する特性上、
僕はRustでRubyのJITを書く仕事をしているのだが、去年の12月くらいから、趣味ではRubyでRubyのJITを書いている。 それまではC言語でコード生成を行なうMJITを5年くらいメンテしていたのだが、先月、Rubyで機械語を直接アセンブルするRJITに差し替えた。 github.com なので、今Rubyのmasterブランチには、会社で業務として開発しているRust製のYJITと、僕が趣味で開発しているRuby製のRJITの2つのJITコンパイラが存在している。余談だが、JITの開発をしすぎてRubyの作者であるまつもとさんのコミット数を最近抜いた。 なぜMJITをやめたのか MJITも結構がんばっていて、去年開発していたRuby 3.2ではMJITのコンパイラの実装をCからRubyにフルスクラッチした上、バックグラウンド処理をpthreadからfork + SIGCHLDで行
Kernel/VM探検隊は、カーネルやVM、およびその他なんでもIT技術の話題ジャンルについて誰でも何でも発表してワイワイ盛り上がろうという会です。monochrome氏は、Ruby処理系「monoruby」について発表しました。 高速な実行が可能なRuby処理系「monoruby」 monochrome氏(以下、monochrome):monochromeといいます。今日は「機械語で書くRuby処理系のその後」ということで、前回の発表のその後を報告いたします。 自己紹介です。monochromeといいます。(スライドを示して)Twitterはこれです。最近、Twitterは治安が悪いので、Mastodonにアカウントを作りました。RustでRubyの処理系を作っています。プログラミング処理系、言語処理系が好きな人の集まりのSlackとか、最近はこの「Zulip」というアプリに移動して、こ
I’m Takashi Kokubun (@k0kubun), a Staff Developer at Shopify who works on optimizing YJIT full-time, which is Ruby’s production-grade JIT compiler written in Rust. While I work solely on YJIT during my work hours, I’ve also maintained another JIT in Ruby, MJIT, in my spare time. This year, I proposed to change the MJIT’s design to simplify the Ruby VM, which will ultimately make the YJIT developme
full diff1: 55367b3...22d944c Description This PR replaces the current implementation of MJIT with a new JIT called "RJIT" 2. RJIT uses a pure-Ruby assembler to generate native code MJIT requires a C compiler at runtime. YJIT requires a Rust compiler at build time. RJIT doesn't require them. This means that RJIT's warmup could be slower than YJIT, but it's still much faster than MJIT's. The code g
CRuby(3.2.0-preview3)およびCRubyの新しいJITコンパイラ・モジュールであるYJITを有効にした場合と、monoruby(JITあり・なし)の単位時間当たりの実行回数をbenchmark-driver.gem を用いて比較しています。数字が大きい方が速いです。ベンチマークの種類によりますが、YJITと比較しても高速、特に浮動小数点演算を多数実行するso_mandelbrotやso_nbody、app_aobenchでは数倍高速となっています。インタプリタもCRuby(JITなし)と遜色ない速度になっています。 以下、設計と実装について紹介していきますが、その前に必要な基礎知識をおさらいしておきます。 基礎知識 JITコンパイラは実行時に対象言語のプログラムを機械語へコンパイルするモジュールですが、一般的な実装ではインタプリタと並存して動きます。プログラムは抽象構文木
As a rule, RTL code contains fewer instructions than stack-based instructions, and as result spends less time in interpreter instruction dispatch code. But RTL sometimes spends more time in operand decoding. More importantly, RTL code results in less memory traffic, because local variables and stack values are addressed directly by RTL instructions. Therefore, stack pushes and pops of local variab
estie でソフトウェアエンジニアをしている徳永(@yTo_9)です。 estie では Ruby を書いたりTypeScriptを書いたりしています! estie 夏のブログ祭りにかこつけて、せっかくなら普段は追わない部分だけど、気になっていたYJITなるものを深掘りしてみようと思い、「YJITがなぜRailsアプリケーションの高速化を実現できたのか」を調べてみたので紹介したいと思います。 「どうせ難しいんでしょ?」と思いながら調べてみたのですが、講演や論文の説明がわかりやすく、意外に概要を把握することは難しくありませんでした。 YJIT の核となっているのは Lazy Basic Block Versioning (LBBV) という手法で、これはRubyだけに限らず動的言語全般に適用可能な強力なアプローチであることがわかりました。 「あるタイプの条件分岐は、ほとんどの場合で片側しか
This post explores the new type-based optimizations in Erlang/OTP 25 where the compiler embeds type information in the BEAM files to help the JIT (Just-In-Time compiler) to generate better code. The best of both worlds # The SSA-based compiler passes introduced in OTP 22 does a sophisticated type analysis, which allows for more optimizations and better code generation. There are, however, limits t
For the past three years, I have spent half of my work time on the MIR project. The goal is to create a universal lightweight Just-in-Time (JIT) compiler, and the project's cornerstone is a machine-independent medium-level intermediate representation (MIR). For more about the project, see my previous articles on Red Hat Developer: MIR: A lightweight JIT compiler project The MIR C interpreter and J
概要 Shopify Engineeringの許諾を得て翻訳・公開いたします。本記事は公開前にShopify Engineeringにレビューをいただいています。 英語記事: YJIT: Building a New JIT Compiler for CRuby — Development (2021) 原文公開日: 2021/10/14 原著者: Maxime Chevalier サイト: Shopify Engineering 画像は元記事のものです(追記2021/11/04: 冒頭イラストを削除いたしました)。 本記事はTwitterにて@shiroemonsshiromemonsさまからのリクエストを受けて翻訳いたしました。リクエストありがとうございます! なお、以下のissue #18229で、著者のMaxime Chevalierさんをコミッターに迎えるプロポーザルが出され、そ
Opens in a new windowOpens an external siteOpens an external site in a new window The 1980s and 1990s saw the genesis of Perl, Ruby, Python, PHP, and JavaScript: interpreted, dynamically-typed programming languages which favored ease of use and flexibility over performance. In many ways, these programming languages are a product of the surrounding context. The 90s were the peak of the dot-com hype
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く