octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59711] Performance of `cd` is bad on Windows


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #59711] Performance of `cd` is bad on Windows
Date: Sun, 7 May 2023 06:00:37 -0400 (EDT)

Update of bug #59711 (project octave):

                  Status:          Ready For Test => In Progress            

    _______________________________________________________

Follow-up Comment #26:

I managed to compare the latest version to Octave 8.2.0.
There seems to be a very slight difference only.

I attached a profiler to both versions:
With Octave 8.2.0, `octave_stat_wrapper` is call 68 times while executing `pkg
load ltfat`.
With the latest development version, that number reduced to 58 times.

The majority of the remaining calls seems to be come via `subdirs_modified` in
"load-path.cc".
It's not as straight forward to replace that one because it does not only
check if a file exists. But it also uses other fields from the stat structure
to check if a file (or folder in this case) was modified since the last time
we checked.

There are native Windows functions that are probably more efficient than stat
on that platform, e.g., `GetFileTime`:
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfiletime

But the FILETIME structure that function uses is not directly compatible to
the fields that we use in octave::sys::time.
Not sure how to abstract that to something platform independent (that can
still be used efficiently on any platforms and doesn't pollute the code with a
lot of `#if defined`).

Maybe, I'll just try and hack something together to check if this will really
make a difference before thinking about a nice implementation...



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59711>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]