From: Brian Candler Date: 2009-04-30T05:21:18+09:00 Subject: Re: Weird performance issue court3nay wrote: > It's not just requiring > libraries -- I can reproduce with pure math. On the "fast" machine: > > irb(main):007:0> Benchmark.realtime { 1000.times { 10 ** rand > (1000) } } > => 0.00720095634460449 > > On the "slow" machine.... > > Benchmark.realtime { 1000.times { 10 ** rand(1000) } } > => 0.142554998397827 Then that rules out rubygems, since under 1.8.6, unless you require 'rubygems' (or have -rubygems in your RUBYOPT) it won't be touched at all. Make sure you don't compare just real time, but also CPU time used on the two machines. If the CPU time is the same but the real time is vastly different, it could mean that one VM is running a bunch of other processes (compare load average using 'uptime'), or that one VM is deprioritised with respect to the other. I've never heard of "arch linux" (is that a distribution?), but assuming it comes with the usual bits of code, I'd also suggest running a comparable benchmark using say Perl. e.g. $ time perl -e 'for ($i=0;$i<1000000;$i++) {10*10}' real 0m0.737s user 0m0.720s sys 0m0.008s If the times are vastly different between the two machines, then you know the problem is nothing to do with ruby and is something to do with the VM platform. If the times are identical for Perl but different for Ruby, then something odd is going on. You can try copying the Ruby from one over to the other, but that's unlikely to explain the difference if Ruby came from the distro as a binary, or was the same binary unpacked from a tarball. Regards, Brian. -- Posted via http://www.ruby-forum.com/.