TruffleRuby

A High-Performance Ruby Implementation on top of @graalvm. Posts by @eregon. TruffleRuby logo copyright (C) 2017 Talkdesk Inc, CC BY 4.0.

2025-05-15

TruffleRuby can now run C/native extensions in parallel, just like Ruby code runs in parallel in Threads on TruffleRuby!
Native extensions need to opt in with rb_ext_ractor_safe(true) or rb_ext_thread_safe(true). Many gems already do that.
See github.com/oracle/truffleruby/ for more details.

2025-03-18

TruffleRuby 24.2 is released!πŸš€πŸŽ‰
It uses the new Java Foreign Function and Memory API when used in JVM mode to speedup C extensions like sqlite3, trilogy and json by 2 to 3 times!
It redesigns encoding negotiation so many String operations are now faster.
It updates to Ruby 3.3 and contains many compatibility and bug fixes.
All changes: github.com/oracle/truffleruby/
Blog post: medium.com/graalvm/whats-new-i

TruffleRuby boosted:
Benoit Dalozeeregon@ruby.social
2025-03-14

New blog post: β€œMatching Regexps 200 Times Faster”
eregon.me/blog/2025/03/14/matc

2024-09-18

TruffleRuby 24.1 is released!πŸš€πŸŽ‰ It updates to Ruby 3.2.4, gets a lot of compatibility and bug fixes, and significant performance improvements: github.com/oracle/truffleruby/

The main performance improvement is a complete review of all 100+ inline caches to ensure they use splitting to keep these inline caches as fast and monomoprhic as possible. You can find more information about splitting and inline caches in this talk: rubykaigi.org/2023/presentatio

2024-03-20

Native extensions are now compiled using the system toolchain and executed natively instead of using GraalVM LLVM (Sulong), which leads to faster startup, faster warmup, better compatibility, smaller distribution and faster installation.

Full support for the Ruby 3.2 & 3.3 syntax, including pattern matching, was made possible by adopting the Prism parser, which is about twice as fast as the old parser!

2024-03-20

TruffleRuby 24.0 is released!πŸš€πŸŽ‰ It ships with 3 major features:
* Native extensions are executed natively for faster warmup
* Near-complete support for Ruby 3.2 (97.4% of specs)
* Full support for the Ruby syntax by adopting the Prism parser

All changes: github.com/oracle/truffleruby/
Blog post: medium.com/graalvm/whats-new-i

2024-02-17

This was a large effort which started a year ago and was the main focus of Andrii Konchyn for the last 4 months, but is all worth it maintenance-wise, especially since the old parser (based on parse.y) was difficult to update. Prism also has a much cleaner AST and is well designed.

2024-02-17

TruffleRuby is now using Prism as its Ruby parser! πŸš€ This means *all* the Ruby 3.3 syntax is supported, no exception! It is also twice as fast as the previous parser written in Java! And future Ruby syntax will be available very quickly in TruffleRuby. github.com/oracle/truffleruby/

2024-01-16

TruffleRuby 23.1.2 is released!πŸš€πŸŽ‰ This is a patch release and contains important bug fixes as well as fixing issues with XCode 15 on macOS.
ChangeLog: github.com/oracle/truffleruby/

2023-09-20

There is also a new JVM Standalone distribution, documented in the README: github.com/oracle/truffleruby/

The JVM Standalone is much easier to install, only has ruby-related executables in bin/ and is smaller than GraalVM + `gu install ruby`!

2023-09-20

TruffleRuby 23.1 is released!πŸš€πŸŽ‰
The Native Standalone now uses G1 GC on Linux, which is much faster! This release also targets Ruby 3.2.

Truffle Unchained blog post: medium.com/p/13887b77b62c
Summary: medium.com/p/1e5c8cdaaff
ChangeLog: github.com/oracle/truffleruby/

TruffleRuby boosted:
2023-09-20
TruffleRuby boosted:
Benoit Dalozeeregon@ruby.social
2023-09-05

Last week I reimplemented @truffleruby's IO.select using poll(2): github.com/oracle/truffleruby/. This not only fixes the issue that select()'s FD_* macros don't handle fd >= 1024 but also makes it faster, e.g. IO.select([1000]) is 2 times faster than before!

One might think IO.select (from the name) should use select(2) but poll(2) is actually a better fit since IO.select takes arrays of Ruby IO objects, not bitsets. select()'s bitsets of 1024 bits means it's 16 words of 64-bit to scan, not cheap.

TruffleRuby boosted:
Benoit Dalozeeregon@ruby.social
2023-08-27

TruffleRuby 23.1 (to be released on Sep 19) is 4.6x and 3.5x faster than CRuby 3.2 on the new yjit-bench fluentd benchmark!

The fluentd benchmark was recently added in yjit-bench (github.com/Shopify/yjit-bench/) and I was eager to run it on TruffleRuby to see how it fares. Profiling revealed a small issue with Array#<< and with that fixed (github.com/oracle/truffleruby/) we get this nice speedup.

2023-06-14

TruffleRuby 23.0 is released!πŸš€πŸŽ‰ The new Oracle GraalVM distribution makes TruffleRuby even faster, uses less memory, and is released under the GFTC license, which is free for development and production use! medium.com/graalvm/whats-new-i
Now available in ruby-build and setup-ruby!

The 23.0 release also brings near-complete compatibility with Ruby 3.1 and has lots of improvements! We thank Shopify for the many contributions. Full ChangeLog at github.com/oracle/truffleruby/

TruffleRuby boosted:
2023-06-14

Introducing a new distributionβ€Šβ€”β€ŠOracle @graalvm!
Use all the greatest GraalVM features, both for development and in production, for free!πŸš€

Learn more: medium.com/graalvm/a-new-graal

2023-05-05

The idea is to use a representation similar to blog.toit.io/hash-maps-that-do

2023-05-05

We are excited to have MMosy (github.com/moste00) join us for a for a Google Summer of Code and work on implementing a faster and more compact Hash representation in TruffleRuby! #GSoC

2023-04-28

TruffleRuby 23.0.0-preview1 is released!πŸš€πŸŽ‰ It brings compatibility with Ruby 3.1 and has lots of improvements! We decided to release a preview now since it has been a while since the last release. 23.0.0 is planned for June 13.
ChangeLog: github.com/oracle/truffleruby/

TruffleRuby boosted:
2023-04-11

Kevin Menard (@nirvdrum) is a Staff Engineer at Shopify and a member of the team developing @truffleruby. He will be digging into the changes that have made Ruby incrementally better and the big shifts in progress that could bring Ruby performance to a new level, in "Making Ruby Fast(er)." blueridgeruby.com/speakers/kev

Kevin Menard
Making Ruby Fast(er)

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst