Ruby 2.1 With Better Garbage Collection
Written by Alex Denham   
Friday, 03 January 2014

The latest version of Ruby 2.1 has been released with improvements including better performance deriving from major changes to the garbage collector.

Other improvements include support for refinements, decimal and frozen string literals, and support for named captures in StringScanner.

The support for refinements has been improved; in previous versions you were limited to applying refinements to a single Ruby file, but they can now be applied within a module without affecting the top level scope of the file. This is a controversial change that may not be implemented in other versions of Ruby as many developers consider it leads to confusing code.

The support for named captures was introduced for regular expressions in Ruby 1.9, but StringScanner didn't support it until this version.

The improvements to the garbage capture in Ruby should make it faster to use. The changes won’t affect all garbage collection, as not all objects will be treated differently in the new version. Instead, objects will be classified by the VM as sunny or as shady. Sunny objects will be handled by the new generational garbage collector.

rubygc

There’s a good description of the changes in a slide deck prepared  by Ruby developer Koichi Sasada for a talk at RubyKaigi. Popular objects such as Array, String, Hash, Object, and Numeric will be able to take advantage of the new system, and work will continue on other objects to bring them into the scope of the garbage collector.

 

 

ruby

More Information

Introducing Restricted Generational Garbage Collection into CRuby/MRI (pdf)

List of changes in Ruby 2.1.0

Related Articles

Ruby 2.0.0 Emphasizes Lazy

New Ruby Website Now Open

Ruby turns 18

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


JetBrains Improves Kubernetes Support In IDE Upgrades
12/11/2024

JetBrains has improved its IDEs with features to suggest the logical structure of code, to streamline the debugging experience for Kubernetes applications, and provide comprehensive cluster-wide Kuber [ ... ]



Ai-Da's Portrait of Alan Turing At Auction
01/11/2024

Sotheby's Digital Art Day Action, now underway, features a large-scale portrait of  Alan Turing created by Ai-Da, the humanoid robot artist whose work, including this canvas, was exhibited at the [ ... ]


More News

Last Updated ( Friday, 03 January 2014 )