From: Ryan Davis Date: 2009-04-17T09:39:01+09:00 Subject: Re: Weird performance issue 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: % ruby -rtracer -e 'require "rubygems"' | cut -f 2 -d : | occur | head 41672: /Library/Ruby/Site/1.8/rubygems/specification.rb 38352: /Library/Ruby/Site/1.8/rubygems/version.rb 3865: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/universal-darwin9.0/rbconfig.rb 3544: /Library/Ruby/Site/1.8/rubygems/requirement.rb 3491: /Library/Ruby/Site/1.8/rubygems/gem_path_searcher.rb 3173: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/fileutils.rb 2329: /Library/Ruby/Site/1.8/rubygems/source_index.rb 1213: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/date.rb 1087: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/optparse.rb 847: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/yaml/tag.rb (occur is a simple script I wrote to aggregate input... I loves it)