From: Rodrigo Rosenfeld Rosas Date: 2011-05-28T22:16:22+09:00 Subject: [ruby-core:36527] Re: [Ruby 1.9 - Bug #3924] Performance bug (in require?) Great work, Xavier! I would like to try it but my RVM installation seems to be broken somehow: rvm install ruby-head --patch /tmp/require-performance-fix.patch Installing Ruby from source to: /home/rodrigo/.rvm/rubies/ruby-1.8.7-p334, this may take a while depending on your cpu(s)... I don't know why it insists on 1.8.7, but I'll try it manually as soon as I have some time, thanks! I'll let you know the feedbacks. Regards, Rodrigo. Em 27-05-2011 22:11, Xavier Shay escreveu: > Issue #3924 has been updated by Xavier Shay. > > > My last problem was related to the build system pushing things into $" and bypassing require. > > I now have a patch that I woud like to submit for consideration: > https://gist.github.com/996418 > > I am going to try and get some more eyeballs on this to test it more thoroughly: > http://rhnh.net/2011/05/28/speeding-up-rails-startup-time > ---------------------------------------- > Bug #3924: Performance bug (in require?) > http://redmine.ruby-lang.org/issues/3924 > > Author: Carsten Bormann > Status: Open > Priority: Normal > Assignee: > Category: core > Target version: 1.9.3 > ruby -v: ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10] > > > =begin > Running irb< /dev/null in 1.9.2 causes 3016 calls to lstat64. > > For instance, there is a sequence of 28 repetitions each of lstat calls to all 6 non-empty path prefixes of /opt/local/lib/ruby1.9/1.9.1/irb.rb -- a total of 170 lstats apparently just to load this file; another set of lstats then occurs later for another 18 (times 6) times. Clearly, something is running amok in the calling sequence rb_require_safe -> realpath_rec -> lstat. > > Another example: Running a simple test with the baretest gem causes 17008 calls to lstat. According to perftools.rb, 80 % of the 1.2 seconds of CPU is used in Kernel#gem_original_require (and another 12 in GC, some of which may be caused by this). > =end > > >