Feeds

Why is Ruby on Rails so darn slow?

'Weird and hard to understand'

SANS - Survey on application security programs

Tim Bray, the co-creator of XML turned Ruby on Rails enthusiast, has told developers to face up to lingering performance problems in the scripting stack.

In a keynote at the Silicon Valley Ruby Conference last week, Bray called Rails "a big deal, a hot deal". And the Sun Microsystems director of web technologies is walking it likes he talks it: he's using a lot of Ruby for his development.

But...

"Let's face the facts: Ruby is too slow," Bray told delegates. He says Ruby 1.8.6 - which dominates the enterprise landscape - is up to 20 times slower than Java.

And, despite tests, the cause of the problem remains unclear - is it compilation of Ruby or "some pretty freaking complex and scary stuff" in Rails.

"When you start to run Rails, you get wildly non-linear performance. Rails has worked well on Ruby 1.8.6... everything else is a work in progress. It's weird and it's hard to understand," Bray said.

"Ruby is richly festooned with core libraries and APIs that aren't built in Ruby, they are built in C," he said.

Fellow keynote speaker John Lam, a Microsoft project manager who's leading work porting Ruby to the .NET Framework with IronRuby, also noted "strange anomalies" in the way Ruby works.

Various initiatives are underway to address the Ruby speed problem. These include the Smalltalk-inspired Rubinius that Sun is supporting; the somewhat obscure Maglev; and - of course - JRuby. This runs on the Java Virtual Machine and is up to five times faster than Ruby, according to Bray.

In spite of the go slow, Bray delivered a robust endorsement of Ruby on Rails. For him, the Rails framework drives Ruby's success and gives Ruby an edge over PHP and Sun's beloved Java in speed of development, scalability and maintainability. "The majority of Ruby in the world is driven by Rails," he said.

Rails offers a clean, prescribed and predictable framework that - like PHP - get some of their advantage from choosing to do less. Java Enterprise Edition, meanwhile, is designed for "infinite flexibility".

PHP is widespread and is used in massive applications such as Facebook and Wikipedia, but the accompanying PHP frameworks such as CakePHP, have not followed in terms of deployment, breeding "spaghetti code" that's difficult to fix and extend.

According to Bray, the prescriptive nature of the Rails framework suits most web front-ended applications' database batch needs when it comes to create, repeat, update and delete. The downside? If you need your database calls to do something a little different, you're on your own.

Rails also encourages best practices, through the use of test-driven development to improve construction and model view controller to help maintain applications.

Speed of development is the number-one reason that CTOs at big banks and airlines are calling Bray in to advise on Ruby. "They've heard it gives them applications in months rather than years. That's why Ruby came out of nowhere," he said. "You can get something done faster in Ruby once you've got it built, you can do updates and maintenance faster than you can in PHP."

Other languages could learn a thing or two from Rails and Bray predicts frameworks would become more "Rails-like" - meaning the future does not belong to Ruby on Rails alone.®

Top three mobile application threats

More from The Register

next story
Ubuntu 14.04 LTS: Great changes, but sssh don't mention the...
Why HELLO Amazon! You weren't here last time
Next Windows obsolescence panic is 450 days from … NOW!
The clock is ticking louder for Windows Server 2003 R2 users
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
Red Hat to ship RHEL 7 release candidate with a taste of container tech
Grab 'near-final' version of next Enterprise Linux next week
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
prev story

Whitepapers

Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.