Speedup to detect the existence of files on Windows
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.
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?
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).
LGTM. The bleeding edge CI test failure is entirely unrelated and happening on all branches. I'm investigating separately.