MagLev Rocks the Ruby House

Gemstone's MagLev speeds past Ruby performance benchmarks.

PORTLAND, Ore. -- Gemstone Software's demonstration of its new Ruby implementation literally rocked the house at the RailsConf 2008 event for Ruby on Rails developers here May 30.

A packed audience was wowed by the performance possibilities of a Ruby implementation Gemstone is working on known as MagLev. Avi Bryant, a developer on the MagLev team, said the technology is named after magnetically levitating trains, which roll along at speeds much greater than conventional trains.

When Bob Walker, project manager on the MagLev effort, showed benchmark results, the room was abuzz. After all, Ruby is not known for its performance. Yet Bryant showed benchmarks that indicated MagLev was significantly faster than the most-used Ruby environment, known as MRI, or Matz's Ruby Interpreter, named after Ruby creator Yukihiro Matsumoto. Walker said that when Antonio Cangiano, an IBM software engineer and technical evangelist who also is a Ruby enthusiast and blogger, saw the MagLev results, his reaction was, "Holy [expletive]!" In a blog post after the Gemstone presentation, Cangiano said that truly was his first comment, "and I don't like to swear."

Although MagLev takes its name off the play on trains and tracks, which the popular Web development framework Ruby on Rails popularized, the MagLev implementation does not yet run Rails, Bryant said. The Ruby on Rails community released version 2.1 of the framework May 31.

"It's a goal to run Rails," Bryant said. He said Gemstone's goal for RailsConf was to be able to run WEBrick, a Ruby library for building HTTP servers. "We do run Ruby reasonably well," he said.

However, Bryant said Gemstone has only been working on MagLev for about 100 days. By the time it is done, MagLev should play a significant role in helping Rails to scale, Bryant said. "Look at a typical Rails deployment, it's a number of Ruby instances spread over several servers," he said. However, MagLev provides a new Ruby implementation that features its own object cache and storage. "And the difference with MagLev is this is all integrated and knows about each other," he said.

"We think this is going to bring Rails to an entirely next level," Walker said.

MagLev is based on the Gemstone Smalltalk VM (virtual machine). MagLev uses multiple VMs and these VMs connect to a shared object cache that can exist on multiple host machines, Walker said.

"MagLev is based on the same VM as our Smalltalk one," Walker said, noting that it also features well-tuned garbage collection and has been extended for new byte code of Ruby.

Walker said Gemstone's Smalltalk VM has been popular in financial services institutions and the intelligence community, among others. The same distributed, transactional data store that supports the Smalltalk VM is available to MagLev, he said. "It is utterly transparent, supports up to 17 petabytes and you can store over a trillion instance," Walker said of the data store.

Thus far, Gemstone has implemented a large subset of the core Ruby classes in MagLev, Walker said. He said the team plans to run the code against the Rubinius project's Ruby Specs to check for compatibility issues.

He said Gemstone also will be looking for community involvement in the project. Although pricing has not been finalized, there will be a free version of MagLev, he said.

In his blog, Cangiano said the announcment "has the potential to revolutionize the Ruby community. It's not just a matter of a substantial speed increase, Ruby's main weakness, it's also a matter of scalability, paradigm shift and enterprise perception. When you get to use an object persistence model that can hold up to 17 petabytes [that means 17 million gigabytes for you], with the ability to scale by simply adding instances, the whole 'Ruby doesn't scale' FUD [Fear, Uncertainty and Doubt] starts to fade real fast."

Meanwhile, in a later blog post after doing some testing of his own, entitled "MagLev handles trees like a monkey," Cangiano said: "MagLev is going to be a fast implementation of Ruby."