From: djberg96@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:91656] [Ruby trunk Bug#15633] Pathological slowdown in File.expand_path on UNC paths on Windows
Date: Sun, 03 Mar 2019 12:30:31 +0000 (UTC) [thread overview]
Message-ID: <redmine.issue-15633.20190303123031.f4798cbdb473fd2d@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15633.20190303123031@ruby-lang.org
Issue #15633 has been reported by djberg96 (Daniel Berger).
----------------------------------------
Bug #15633: Pathological slowdown in File.expand_path on UNC paths on Windows
https://bugs.ruby-lang.org/issues/15633
* Author: djberg96 (Daniel Berger)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
For a while now, including Ruby 2.5, calling File.expand_path on an absolute UNC path seems to be strangely slow. I've put together some benchmarks here:
```
require 'benchmark'
MAX = 200000
Benchmark.bm(30) do |x|
x.report("expand_path('foo/bar')") do
str = "foo/bar"
MAX.times{ File.expand_path(str) }
end
x.report("expand_path('C:/foo/bar')") do
str = "C:/foo/bar"
MAX.times{ File.expand_path(str) }
end
x.report("expand_path('//foo/bar')") do
str = "//foo/bar"
MAX.times{ File.expand_path(str) }
end
x.report("expand_path('foo//bar///')") do
str = "foo//bar///"
MAX.times{ File.expand_path(str) }
end
x.report("expand_path('~')") do
str = "~"
MAX.times{ File.expand_path(str) }
end
x.report("expand_path('')") do
str = ""
MAX.times{ File.expand_path(str) }
end
x.report("expand_path('', '~')") do
MAX.times{ File.expand_path('', '~') }
end
end
```
What I see is that most of these take only a second or two, while the UNC path takes 30+ seconds.
--
https://bugs.ruby-lang.org/
parent reply other threads:[~2019-03-03 12:30 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <redmine.issue-15633.20190303123031@ruby-lang.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.issue-15633.20190303123031.f4798cbdb473fd2d@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).