Peter Zhu

Peter Zhu

@peterzhu.ca

Staff Developer at Shopify. Ruby core committer. Photography geek. Mastodon: @peterzhu2118@ruby.social Instagram: @peterzhu.photos

467 followers34 following50 posts

Ruby has a new moving GC. I just merged moving Immix in the MMTk Ruby binding. This is exciting as its the first GC that dynamically detects fragmentation in the heap and performs defragmentation. Performance isn't too great yet but I'm working on it! github.com/ruby/ruby/pu...

github.comImplement moving Immix in MMTk by peterzhu2118 · Pull Request #15744 · ruby/rubyThis commit implements moving Immix in MMTk, which allows objects to move in the GC. The performance of this implementation is not yet amazing. It is very similar to non-moving Immix in many of the...

I implemented Ruby's heap algorithm in MMTk in a day and 100 lines. Ruby's default GC is 10k+ lines. This doubles MMTk's performance from over 2x slower to almost on par. And I still haven't unlocked MMTk's true powers like generational GC or moving GC. github.com/ruby/mmtk/pu...

github.comImplement Ruby heap by peterzhu2118 · Pull Request #54 · ruby/mmtkThis heap emulates the growth characteristics of the Ruby default GC's heap. By default, the heap grows by 40%, requires at least 20% empty after a GC, and allows at most 65% empty before it sh...

Peter Zhu reposted

Friday was my last day of an incredible journey at Shopify. In the past 5 years, I had the privilege of working on some cutting edge projects to advance Ruby with some of the most talented and well-known developers. Shopify will always have a very special place in my heart.

Shopify sponsors and collaborates with academia to take Ruby to new heights. We're working with Australian National University to integrate Memory Management Toolkit into Ruby. Earlier this year, we published a paper about it. Today, we wrote a blog post: railsatscale.com/2025-09-16-r...

railsatscale.comReworking Memory Management in CRubyShopify sponsors and collaborates with academia to take Ruby to new heights. In this post, we give an overview of what we’ve built in collaboration with the Australian National University.

If you missed it, my recent #rubykaigi talk “Modular Garbage Collectors in Ruby” covered: ⚙️ Features the current Ruby GC lacks 🔄 Implementation of the Modular GC feature in Ruby 3.4 🔨 What MMTk is and the integration with Modular GC The recording will be up in a few months!

You are up to date.