From: "Jonas Pfenniger (zimbatm)" Date: 2011-01-09T08:07:26+09:00 Subject: [ruby-core:34262] Re: Avoiding $LOAD_PATH pollution Just a note for future references. While playing with require, I found that 1.9 was particularly slow on startups because of require. I suspect it has something to do with the path expansions. $ touch Gemfile $ rvm use ruby-1.9.2 Using /Users/zimbatm/.rvm/gems/ruby-1.9.2-p136 $ RUBYOPT=-rprofile bundle install 2>&1 >/dev/null | head -n 6 % cumulative self self total time seconds seconds calls ms/call ms/call name 43.04 1.02 1.02 197 5.18 31.98 Kernel.gem_original_require 15.19 1.38 0.36 41288 0.01 0.01 Hash#default 2.53 1.44 0.06 1546 0.04 0.05 Kernel.=== 1.69 1.48 0.04 171 0.23 2.22 Array#each $ rvm use ruby-1.8.7 Using /Users/zimbatm/.rvm/gems/ruby-1.8.7-p330 $ RUBYOPT=-rprofile bundle install 2>&1 >/dev/null | head -n 6 % cumulative self self total time seconds seconds calls ms/call ms/call name 13.71 0.24 0.24 168 1.43 17.26 Kernel.gem_original_require 9.14 0.40 0.16 139 1.15 8.56 Array#each 4.00 0.47 0.07 3229 0.02 0.02 Module#method_added 3.43 0.53 0.06 2127 0.03 0.03 Module#=== $ rvm use ruby-1.9.2 Using /Users/zimbatm/.rvm/gems/ruby-1.9.2-p136 $ RUBYOPT=-rprofile rails help 2>&1 >/dev/null | head -n 6 % cumulative self self total time seconds seconds calls ms/call ms/call name 34.25 0.75 0.75 156 4.81 45.45 Kernel.gem_original_require 7.31 0.91 0.16 385 0.42 0.62 Array#include? 6.85 1.06 0.15 25979 0.01 0.01 Hash#default 5.48 1.18 0.12 298 0.40 1.41 Array#each $ rvm use ruby-1.8.7 Using /Users/zimbatm/.rvm/gems/ruby-1.8.7-p330 $ RUBYOPT=-rprofile rails help 2>&1 >/dev/null | head -n 6 % cumulative self self total time seconds seconds calls ms/call ms/call name 12.50 0.30 0.30 142 2.11 35.21 Kernel.gem_original_require 9.58 0.53 0.23 271 0.85 8.60 Array#each 8.75 0.74 0.21 1892 0.11 0.18 Array#include? 5.83 0.88 0.14 7964 0.02 0.02 String#==