[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Wind
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows |
Date: |
Mon, 21 Dec 2020 04:07:41 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66 |
Update of bug #59706 (project octave):
Item Group: Feature Request => Performance
Status: None => In Progress
Summary: Add function that normalizes a file path => Avoid
"canonicalize_file_name" on Windows
_______________________________________________________
Follow-up Comment #8:
@Rik: I agree with most of your comment.
But `canonicalize_file_name` does more than just normalizing the file name and
checking whether it exists. Among other things it also resolves symbolic
links.
If the result of `canonicalize_file_name` is used as a key to identify a
physical file, that (or some other step this function does) might (or might
not) be relevant.
Gnulib's implementation for `canonicalize_file_name` on Windows is slow. We've
already seen that in the past. So it might be best to avoid it (on Windows)
where possible(!).
I didn't come around to analyzing the call stack of the slow code path here
until now.
If I understand the call stack in comment #5 correctly, it is in `file_stat`
where `canonicalize_file_name` is called.
I added calling this function with the change here:
https://hg.savannah.gnu.org/hgweb/octave/rev/372f42f122bd
I don't remember now if using that function was strictly necessary or I just
didn't know (or didn't remember) that it was slow on Windows back then.
I'll try whether Octave's file_stat will still work on Windows with a change
similar to this:
diff -r 403a9f626ba2 liboctave/system/file-stat.cc
--- a/liboctave/system/file-stat.cc Sun Dec 20 18:48:41 2020 +0100
+++ b/liboctave/system/file-stat.cc Mon Dec 21 09:40:43 2020 +0100
@@ -194,12 +194,7 @@
std::string full_file_name = sys::file_ops::tilde_expand
(file_name);
#if defined (OCTAVE_USE_WINDOWS_API)
- std::string canon_file_name
- = sys::canonicalize_file_name (full_file_name);
-
- // Might have failed for files with non-ASCII characters in name
- if (! canon_file_name.empty ())
- full_file_name = canon_file_name;
+ full_file_name = sys::env::make_absolute (full_file_name);
// Remove trailing slashes
while (full_file_name.length () > 1
If this works, that would have the additional benefit that it renders the
fallback for non-ASCII strings unnecessary.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59706>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #59706] canonicalize_file_name performance in Windows, anonymous, 2020/12/17
- [Octave-bug-tracker] [bug #59706] Add function that normalizes a file path, Markus Mützel, 2020/12/17
- [Octave-bug-tracker] [bug #59706] Add function that normalizes a file path, anonymous, 2020/12/17
- [Octave-bug-tracker] [bug #59706] Add function that normalizes a file path, Rik, 2020/12/17
- [Octave-bug-tracker] [bug #59706] Add function that normalizes a file path, Markus Mützel, 2020/12/18
- [Octave-bug-tracker] [bug #59706] Add function that normalizes a file path, anonymous, 2020/12/18
- [Octave-bug-tracker] [bug #59706] Add function that normalizes a file path, anonymous, 2020/12/18
- [Octave-bug-tracker] [bug #59706] Add function that normalizes a file path, Rik, 2020/12/20
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows,
Markus Mützel <=
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, Markus Mützel, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, Markus Mützel, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, anonymous, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, Markus Mützel, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, anonymous, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, anonymous, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, Rik, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, Rik, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, Markus Mützel, 2020/12/21
- [Octave-bug-tracker] [bug #59706] Avoid "canonicalize_file_name" on Windows, Markus Mützel, 2020/12/21