Issue #3924 has been updated by Shyouhei Urabe.


=begin

Hi Xavier.  I'm also reading your patch.

* Though the patch is big, after applying it's super readable than the
  original.  Fairly good.
  * I also like your writing static function declarations.

* Style things are already pointed out by Yusuke so I don't repeat.

* As for the enumerator thing, I think it's worth considering your
  idea.  That enumerator hack is for backward compatibility, so in a
  future when we don't need that hack anymore, we can just delete that
  lib/enumerator.rb.  I think it's cool.

* I'm not sure if your code is ready for case-insensitive filesystems
  like those in Windows.  I'm sure you know the problem so I should
  have missed something.

=end

----------------------------------------
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: -


=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



-- 
http://redmine.ruby-lang.org