views:

231

answers:

5

In every benchmark that I found on the web it seems that Ruby is slow, much slower than Java. The Ruby folks just state that it doesn't matter. Could you give me any example that the speed of Ruby on Rails (and the Ruby itself) really doesn't matter?

A: 

Ruby is a interpreted language and is mainly used for Rapid prototyping.

Ramesh
Doesn't answer the question at all.
Rob
There's a LOT of folks out there running production websites on Rails that might disagree pretty strongly with the "prototyping" bit.
mmc
I said "mainly" and not "only" used for prototyping.
Ramesh
They'd argue with "mainly" too.
mmc
I'd call it more "Rapid production producing" than Rapid prototyping.
Aaron Hinni
+2  A: 

If you have a CMS that renders out a flat site each night at midnight... then your application is running for 1 second per evening in Java, or 2 seconds per night in Ruby. It simply would not matter.

mmc
+10  A: 

You should really only concern yourself with whether or not Ruby on Rails will be fast enough for your use case. To that end, it's certainly fast enough for all of these folks.

Callahad
Agreed. "Fast" is a squishy term. "Fast Enough" is absolute. Your app is, or your app isn't. Ruby is very often (but not always) "fast enough." Java is not the end-all-be-all of speed, either. Well written Ruby can run circles around poorly written Java.
mmc
And for what it's worth, any popular language and framework will be fast enough for most use cases. After all, they became popular because real people are using them in production.In the absence of other constraints, I'd urge you to select the tools that will make you, personally, a more productive developer.
Callahad
Just consider from that List that Twitter is moving most of its backend from Ruby to Scala ( hence Java Virtual Machine )
OscarRyz
@Oscar Your point is well taken. It's possible to outgrow Ruby. But can't we agree that Twitter.com is an exceptional case, and is higher load than most websites that any of us are developing?
mmc
+4  A: 

For many web applications, it is often the case that the bottleneck in the request/response cycle is not the processing speed of the web framework, but rather database access times. Given that, many people find the overhead added by using a relatively slow language a reasonable tradeoff for speed and ease of development.

Greg Campbell
+3  A: 

A typical web application spends very little time doing the things you would write in Ruby or Java and very much time fetching things from a database. If it takes 200ms to deliver a given page using Java and 210ms using RoR, the advantage gained by choosing Java for its speed is insignificant for the vast majority of applications.

If you're really worried about speed in a typical web application, spend your optimization efforts on the data storage and retrieval mechanism, not the front end. Use indexes. Denormalize data if you must. Consider a document database or a key-value store.

Zak