Skip to content

Optimize directory and symlink check in RecurseDirectory on Windows

See: cmake/cmake!6849 (closed)

By storing the WIN32_FIND_DATA we get from FindFirstFile and FindNextFile, we can remove the expensive GetFileAttribute calls that happen inside of FileIsDirectory and FileIsSymlink

When configuring the llvm-project using CMake 10 times in a row with default settings, I see:

Before: avg. 19.637s min. 19.396s max. 19.854s

After: avg. 18.538s min. 18.283s max. 18.846s

Merge request reports

Loading