Ruby 2.1 Released
Ruby 2.1 is officially released. According to Ruby 2.1.0 Released, Delivering new GC Ruby 2.1 release has brought changes in garbage collector that will improve performance.
The “Mark & Sweep” implementation of previous versions is now replaced by the RGenGC
(Restricted Generational Garbage Collection) implementation. As Ruby developer Koichi Sasada had observed in April 2013, the challenge was to implement a GC algorithm that could handle both protected and unsafe objects in the same heap.
RGenGC
implementation uses Write-Barriers so as to avoid rewriting all existing C-extensions to use the new GC. In RubyConf 2013, Sasada showed how 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.
RgenGC
is compatible with existing extensions and also provides performance improvements. Array, String, Hash, Object, and Numeric are all Write-Barrier protected objects, so the RGenGC system can be used in these cases. Work on both internal and external libraries will offer the possibility of additional performance gains in the future.
Other very important improvements, appart from the garbage collection system include RDoc 4.1.0
, RubyGems 2.2.0
, and several updated libraries. You can find a full list of 2.1 release changes at the release notes located at the project’s GitHub page.