From: Urabe Shyouhei Date: 2011-06-01T09:14:52+09:00 Subject: [ruby-core:36649] Re: [Ruby 1.9 - Bug #3924] Performance bug (in require?) Hi Yusuke, (05/31/2011 01:58 AM), Yusuke ENDOH wrote: > Still, trunk is 1.5x slower than 1.9.2 because of the object > generation. > Each require does the something like this: > > $LOADED_FEATURES.map {|f| File.expand_path(f) } > > . > This process creates many objects, i.e., strings. Typically, > $LOADED_FEATURES are already expanded, so the process is not > needed in normal cases. In fact, 1.9.2 expands the paths only > when they are not absolute, like this: > > $LOADED_FEATURES.map {|f| File.expand_path(f) if f is not absolute } If it's the actual problem, why not cache the expanded path? https://github.com/shyouhei/ruby/commit/c229cb4