From: Robert Klemme Date: 2009-04-17T16:03:30+09:00 Subject: Re: Weird performance issue 2009/4/17 Ryan Davis : > > On Apr 16, 2009, at 16:25 , court3nay wrote: > >> Hey, I'm debugging a weird performance issue. I have two VMs on the >> same server running the same OS (arch linux) and the same version of >> "enterprise" Ruby (ruby 1.8.6 (2008-08-08 patchlevel 286) [x86_64- >> linux]). >> >> On one machine, I get these numbers >> >> irb(main):004:0> Benchmark.realtime { require 'rubygems' } >> => 0.0482780933380127 >> irb(main):005:0> Benchmark.realtime { require 'tinder' } >> => 0.395686149597168 >> >> On the other, >> >> irb(main):002:0> Benchmark.realtime { require 'rubygems' } >> => 1.20596885681152 >> irb(main):003:0> Benchmark.realtime { require 'tinder' } >> => 5.7661280632019 > > same number of gems on both slices? > > % gem list | wc -l > > you can also do something really gross like: > > % ruby -rtracer -e 'require "rubygems"' > server1.txt > > I don't think you should necessarily diff the two, but looking at rough > things like # of lines should start to explain stuff. Something maybe like: > If that does not work then "strace" might be an option as well. That usually also contains timestamps and you might be able to spot a syscall which is taking a lot of time. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/