Hacker News new | ask | show | jobs
by chucknibbleston 5067 days ago
Just to put this out there -- since nobody has really mentioned it -- ruby (as a language) doesn't have the greatest performance. You can do some tricks with GC to speed it up (Ruby EE might be a faster option), but you're still looking at 50x slower than C (python is 40x, Java 7 is around 2x, Javascript on V8 -- Node-- is 4x). So if you're planning on doing a lot on the backend, you might want to consider breaking off your logic/processing into java or lisp or something and using a rpc/mq system to send it tasks from your RoR/Django app....but then again...you might not want to start with too many moving parts :)
2 comments

I agree that ruby is slow, and I actually recommended Java, but ruby execution is not going to be the bottleneck for a webapp, the database is.
I disagree that the slow part of a RoR app is the database - from my anecdotal experience, the slowest part is rendering views and the string manipulation there-in, probalby caused by GC. For a Rails 2.3 App with REE and MySQL, time is ~25% GC, ~25% DB and 50% ruby (from NewRelic).

However, premature optimization and all that, don't choose Java because its faster than Ruby in some arbitrary benchmark. Choose Ruby because it makes you happy and you can meet business objectives faster and easier with it.

On the other hand, if you put your DB on SSDs, back to square one.
Do you have any sources for these performance comparisons? It would be great to see actual speed benchmarks for these different languages.
See http://shootout.alioth.debian.org/ as a starting point for language speed comparisons.