From: Lloyd Linklater Date: 2007-11-01T10:00:04+09:00 Subject: Re: JRuby perf questions answered There was a recent thread which asked how fast ruby ran for each user. http://www.ruby-forum.com/topic/125344#new Josip Gracin wrote: > Here's something interesting. The processor is Intel T7200 @ 2.00GHz, > Linux Ubuntu. > > 1. With ruby 1.8.5. which comes packaged with Ubuntu: > > Ruby 1.8.5 on i486-linux > It took 20.346013 seconds to run. 49149 iterations per > second. > > 2. With ruby 1.9.0 (2006-06-08) which comes packaged in Ubuntu: > > Ruby 1.9.0 on i486-linux > It took 23.875774 seconds to run. 41883 iterations per > second. > > > 3. With ruby 1.8.6 compiled from sources on the machine: > > Ruby 1.8.6 on i686-linux > It took 7.107875 seconds to run. 140689 iterations per > second. > > > Obviously, the target instruction set matters quite a lot. I think I'll > be compiling my own ruby from now on. :-) Greg Halsey wrote: > windows xp. intel core2 1.86GHz > > JRUBY: > > C:\jruby\jruby-trunk\bin>jruby calculate.rb > 55 > > It took 41.125 seconds to run. 24316 iterations per > second. > > Not so good. Let's disable ObjectSpace: > C:\jruby\jruby-trunk\bin>jruby -O calculate.rb > 55 > > It took 11.109 seconds to run. 90017 iterations per > second. > > That was good. Now let's give it some more juice: > C:\jruby\jruby-trunk\bin>jruby -J-server -O calculate.rb > 55 > > It took 5.75 seconds to run. 173913 iterations per > second. > -------------------------------------------- > MRI:One-Click > ruby calculate.rb > 55 > > Ruby 1.8.6 patch 0 on i386-mswin32 > It took 15.828 seconds to run. 63179 iterations per > second. Now, I am thinking that jruby might work well if we know how to find the sweet spot. Why the pre compiled version is so very much slower than a home compiled version makes me wonder why they do not compile it better. As things can be so radically different in jruby if only you know how to tweak it perfectly is another thing that makes me think. So, do you find your own benchmarks and work your compiler to make it run at its fastest or is performance going to be "roll your own" for those with insider knowledge? -- Posted via http://www.ruby-forum.com/.