From: Peter Hickman Date: 2010-11-09T23:26:18+09:00 Subject: Re: Ruby Perofrmance Many moons ago I started a thread that advocated writing it in C if you wanted performance. There were several discenting opinions and I set up a little trial to generate all possible latin squares, http://en.wikipedia.org/wiki/Latin_square. People then submitted implementations in languages of their choice and I ran and timed them on the hardware I had. The result was that ocaml beat out the field including hand written C++ and Java, if I recall correctly erlang came a close second followed by java. It does mean however that you need to write the whole of the application in language X (where X is not C, C++ or Java) as bridging ocaml / erlang / haskell to ruby may well negate any advantages. But how important is performance? If it is really really really important then you would do well to look into ocaml or erlang. However if you need to interface efficiently to ruby then C and C++ are a good bet. With jruby you get to access java. The difference between first (ocaml) and third (java) was minimal. A different problem may have reordered the top three but I suspect that they would still be close. This was all 1.8.* if I recall so I'm not sure how 1.9 would place. But then again Jruby has been improving all the time. If you must use ruby but need to speed some part of it up then ruby and a library written in C is one option, jruby and the critical part in java is the other. I would recommend seeing if you can use jruby and then look to code the critical parts in java. It is easier to become competent in Java than it is to become competent in C / C++. Learnt erlang as a result of that post :)