From: pdahorek@... Date: 2017-07-25T11:22:23+00:00 Subject: [ruby-core:82162] [Ruby trunk Bug#13167] Dir.glob is 25x slower since Ruby 2.2 Issue #13167 has been updated by ahorek (Pavel Rosick��). yes, it's on the same hardware and also with the same file path. I used Bash on Windows which could be slower then the native Windows app. So I also compared it on a native Ubuntu and 2.4.1 is faster on it ~~~ 2.1.9 695000 i/s 2.4.1 766827 i/s ~~~ after some digging I found out that this change introduced the problem https://bugs.ruby-lang.org/issues/5994 around this commit https://github.com/ruby/ruby/commit/5b92c0bea3dc23b0c2be356bedafdd4e7f9110d7 ---------------------------------------- Bug #13167: Dir.glob is 25x slower since Ruby 2.2 https://bugs.ruby-lang.org/issues/13167#change-65919 * Author: ahorek (Pavel Rosick��) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.4.0 * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- Hello, we've found a huge speed regression in our Rails app. After some digging the reason is in `Dir.glob` method which is much slower since Ruby 2.2.6. This is probably Windows only! This code is used heavily in Rails for partial lookups: ```ruby Dir.glob('c:/test/myapp/app/views/common/_menu_stats{.en,}{.html,}{}{.erb,.builder,.raw,.ruby,.jbuilder,.coffee,}') ``` Comparsion (x64): jruby 9.1.7.0 2540 i/s ruby 2.1.5 2568 i/s ruby 2.1.9 2569 i/s **ruby 2.2.6 99 i/s 25 times slower! ruby 2.3.3 102 i/s ruby 2.4.0 103 i/s** I would like to help, but I don't know much about Ruby C internals. Please let me know if you need any additional info. Now we're stuck at 2.1.9 because this issue makes the development on more recent versions unusable. ---Files-------------------------------- logruby24.txt (484 KB) logruby21.txt (10.8 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: