I've got a problem counting the files on a fileshare (which are present longer than 1 hour):
The two 'known' methods:
GetFiles
dir.Getfiles.Where(Function(x) x.CreationTime < DateTime.Now.AddHours(-1)).Count()
Link: GetFiles
EnumerateFiles
dir.EnumerateFiles.Where(Function(x) x.CreationTime < DateTime.Now.AddHours(-1)).Count()
Link: EnumerateFiles
Is there any faster method to count the number of files inside a folder/fileshare?
The number of files may vary from 2000 to upwards of 500 000. Both methods shown above show a drastic drop in performance beyond the 30 000 files.
Questions found on SO that didn't resolve it for me: