OpenImageIO icon indicating copy to clipboard operation
OpenImageIO copied to clipboard

Speedup to detect the existence of files on Windows

Open wingfiring opened this issue 1 week ago • 2 comments

Description

On Windows, Filesystem::exists forward the call to std::filesystem::exists, and finally calls _std_fs_get_stats . _std_fs_get_stats is slow if the argument is a netwok path.

Tests

No, performance related.

Checklist:

  • [x] I have read the contribution guidelines.
  • [x] I have updated the documentation, if applicable. (Check if there is no need to update the documentation, for example if this is a bug fix that doesn't change the API.)
  • [x] I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • [x] If I added or modified a C++ API call, I have also amended the corresponding Python bindings (and if altering ImageBufAlgo functions, also exposed the new functionality as oiiotool options).
  • [x] My code follows the prevailing code style of this project. If I haven't already run clang-format before submitting, I definitely will look at the CI test that runs clang-format and fix anything that it highlights as being nonconforming.

wingfiring avatar Dec 10 '25 07:12 wingfiring

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: wingfiring / name: JacksonSun-adsk (14a9eeb5a07e5ad4910e3cce75d312548733ee64)

This looks fine to me. Does anybody with Windows experience wish to comment?

lgritz avatar Dec 10 '25 15:12 lgritz

I'm certainly not a Win32 expert, but this seems correct based on my understanding and some spelunking in the MSVC STL source (which, in hindsight, is not an activity I would recommend).

nrusch avatar Dec 12 '25 21:12 nrusch

LGTM. The bleeding edge CI test failure is entirely unrelated and happening on all branches. I'm investigating separately.

lgritz avatar Dec 12 '25 23:12 lgritz