Skip to content

SystemTools: Add FileId class and GetFileId function

Jochem van Boxtel requested to merge jvanboxtel/kwsys:add-get-file-id into master

Add a FileId class, which encapsulates the identifier internally used by the existing SystemTools::SameFile function. The GetFileId function retrieves a FileId object for the given file or directory. This makes the file identifier cacheable to the calling code, so that checking whether one file is the same as many other candidates can be done faster.

The reason for this change is a performance fix involving FILE_SETs for CMake on Windows (jvanboxtel/cmake@30ad5346), where FileId and GetFileId are used. In the latest CMake on Windows a minimal example project with a file set of 300 files takes 70s to generate, where with the CMake patch it takes only 0.2s on my developer machine

Topic-rename: SystemTools-GetFileId

Edited by Brad King

Merge request reports