JRuby 1.6.0 RC1 Released

After nine months of work, we are proud to announce the release of JRuby 1.6.0 RC1! We’ve added support for Ruby 1.9 APIs, improved performance and Windows support, and addressed tons of user issues. It’s the most important JRuby release yet, and here’s why…

Ruby 1.9.2 Language and API Compatibility

Ruby 1.9.2 compatibility is largely complete. There are a few features that we plan to add in a follow-up release: Encoding::Converter, non-ASCII identifiers, and the ‘ripper’ and ‘fiddle’ libraries. We would like users to test JRuby in 1.9 mode to shake out remaining issues before 1.6.0 final.

Support for Ruby 1.9.2 represents a tremendous amount of work by many contributors. We are very proud to include it in JRuby 1.6.

Improved Ruby Performance

A key factor for performance is how quickly methods can be called. In 1.6 we have improved the performance of Ruby method calls, reducing their overhead substantially. We have also made smaller optimizations across the board in response to user reports and profiling.

Please continue to report performance issues you come across in your own applications. We consider poor performance a bug to be fixed!

Built-in Graph Profiler

In addition to the “flat” profile support added in JRuby 1.5.6 (via the –profile flag) we have added “graph” profiling support (–profile.graph) contributed by Dan Lucraft of the Redcar project. Graph profiles will help you localize performance bottlenecks, making them easier to fix.

~/projects/jruby ➔ jruby --profile.flat -e "def foo; 100000.times { (2 ** 200).to_s }; end; foo"
Total time: 0.99

    total        self    children       calls  method
     0.99        0.00        0.99           1  Object#foo
     0.99        0.08        0.90           1  Fixnum#times
     0.70        0.70        0.00      100000  Bignum#to_s
     0.21        0.21        0.00      100000  Fixnum#**
     0.00        0.00        0.00         145  Class#inherited
     0.00        0.00        0.00           1  Module#method_added

Check out my blog post on the new JRuby graph profiler.

RubyGems Changes

This release updates our bundled RubyGems to 1.4.2. RubyGems 1.4.2 has eliminated several bottlenecks impacting startup speed, and fixed several issues from previous releases. Both 1.8 and 1.9 modes use RubyGems 1.4.2 in JRuby. Also, in response to user requests, we have disabled the generation of ri and rdoc when installing gems. See the ‘gem rdoc’ command to generate docs offline.

We also unbundled rspec and ruby-debug in this release. You should be able to gem install them normally.

C Extension Support (Experimental)

For Ruby Summer of Code 2010, Tim Felgentreff helped us build out support for Ruby’s C extension API. JRuby 1.6 includes that support as an experimental feature. The first release candidate only ships C extension support prebuilt for OS X, but we hope to include it prebuilt for Windows and Linux by 1.6.0 final. If you need to build it for your platform, follow these instructions for building JRuby C extension support.

We recommend users implement JRuby extensions in Java or use a Java library when possible, and consider using FFI to wrap C libraries, but we hope C extension support will make it easier to migrate to JRuby.

RubyGems Maven Support (Preview)

Continuing our efforts to integrate Ruby and Java ecosystems, JRuby 1.6 includes a preview of integration between RubyGems and Maven. Any artifact published to a Maven repository can be installed with the “gem” command, and gems targeting JRuby can depend on Maven artifacts directly. This support requires Maven 3 to be installed, or alternatively you can install the ruby-maven gem.

Here’s an example of installing the Quartz library for scheduled jobs. The Quartz library has a Maven group ID of “quartz” and an artifact ID of “quartz”:

~/projects/jruby ➔ gem install quartz:quartz
Successfully installed quartz.quartz-1.5.1-java
1 gem installed

You can also specify Maven artifacts in gemspecs, and the appropriate jars will be fetched and installed. The entire world of Java libraries is now at your fingertips!

This is a technology preview, so we may revise it based on user reports and feature requests.

Improved Compatibility and User Experience on Windows

The JRuby team has always valued Windows as a user platform, and with this release we have promoted Windows to being a primary supported platform. We added Windows to our continuous integration servers, and have been maintaining a green test suite there. We encourage all Ruby users on Windows to try JRuby and let us know if there are remaining bugs or usability issues we need to fix.

Look for Tom Enebo’s post on JRuby’s excellent Windows support tomorrow.

Over 2000 Commits and 265 Issues Resolved

JRuby 1.6 is our largest release to date. We have fixed more bugs, committed more revisions, and accepted contributions from more users than ever before. Expect to see more detailed blog posts from us and others on the above features in the coming weeks.

We thank the JRuby community for their continued support, and Engine Yard for their sponsorship!