garrynewman/bootil — pull request #6 by assassini (2013-05-04 14:33:41+00:00)
Title: Hopefully fixed the performance issues with the symbolic link fix

I managed to get the average time spent in HasChanges down from 12.7 milliseconds to a whooping 0.17 milliseconds (in a debug build, release is probably even faster).

So the core problem with symbolic links was that ReadDirectoryChangesW ignores changes happening inside symbolic links even if bWatchSubtree is true. It works if the main directory itself is a symbolic link though.

I previously fixed this by calling ReadDirectoryChangesW for each subdirectory. I didn't realize that it would have such a large performance penalty.

The new logic is to call ReadDirectoryChangesW only for each subdirectory that is a symbolic link.