BT

InfoQ Homepage News Ruby 2.1.0 Released, Delivering new GC

Ruby 2.1.0 Released, Delivering new GC

Bookmarks

The official release of Ruby 2.1 has arrived, bringing with it a number of anticipated improvements, including big changes to the garbage collector which will bring several performance enhancements now and in the future. 

The garbage collector in Ruby 2.1 implements a form of generational garbage collection, with Ruby calling their implementation RGenGC (Restricted Generational Garbage Collection).  This replaces the “Mark & Sweep” implementation used in previous versions of Ruby.  A presentation by Ruby developer Koichi Sasada in April 2013 observed that the challenge for Ruby developers was to implement a GC algorithm that could handle both protected and unsafe objects in the same heap. 

Since rewriting all existing C-extensions to use the new GC is not practical, Write-Barriers are used as part of the RGenGC implementation.  As Sasada explains in a presentation (PDF) given at RubyConf 2013, RGenGC provides a third way given the 2 original alternatives:  A) Do not implement generational GC at all (as in Ruby 2.0 & before) or B) Implement Generational GC with a requirement that all C-extensions are rewritten. 

Using RGenGC provides high compatibility with existing extensions while still bringing performance improvements.  Popular objects Array, String, Hash, Object, and Numeric are Write-Barrier protected, thus able to take advantage of the RGenGC system.  Future work on both internal and external libraries offer the possibility of additional performance gains in the future.

The new garbage collection system is not the only improvement, others include RDoc 4.1.0, RubyGems 2.2.0, and several updated libraries.  For a complete list of 2.1’s changes take a look at the release notes located at the project’s GitHub page.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.