Issue #10015 has been updated by Aaron Patterson.


@nobu this change causes a significant increase in Rails boot time on my system.

My application pays a 120ms price for this change.  @hsbt will pay 520ms:

  http://twitter.com/hsbt/status/486378979138367488

Is there a way we can keep the performance on case-insensitive file systems?  If there really is no work-around, then we need to make some changes in RubyGems, bundler, minitest, and Rails before trunk is released because many people will complain about slow boot times. :(

----------------------------------------
Bug #10015: Performance regression in Dir#[]
https://bugs.ruby-lang.org/issues/10015#change-47662

* Author: Aaron Patterson
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-02-04 trunk 44802) [x86_64-darwin13.0]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
r44802 seems to have introduced a performance regression in Dir#[].

Here is the test program:

~~~ruby
require 'benchmark'

puts Benchmark.realtime {
  glob = "minitest/*_plugin.rb{,.rb,.bundle}"
  $LOAD_PATH.map { |load_path|
    Dir["#{File.expand_path glob, load_path}"]
  }.flatten.select { |file| File.file? file.untaint }
}
~~~

Here is the test time for me:

~~~
$ ruby -v test.rb
ruby 2.2.0dev (2014-02-04 trunk 44801) [x86_64-darwin13.0]
0.000341
$ ruby -v test.rb
ruby 2.2.0dev (2014-02-04 trunk 44802) [x86_64-darwin13.0]
0.009333
~~~

r44801 seems much faster than r44802.



-- 
https://bugs.ruby-lang.org/