Poor performance for GetDirectories/GetFiles
taori opened this issue · comments
I am using this package in my project at https://github.com/taori/VolumeScanner2/tree/bugfix/performanceoptimization
However after a lot of Performance optimization i came to a point where the hot path are the two methods in the title - Do you think there is any way those methods could be sped up anymore or is it just slow by nature of things?
on a m2ssd scanning 150gb recursively takes 27 seconds. Does that seem reasonable or is there room for more performance?
Just a wild guess:
Probably it would be good to not get the whole thing into memory but use something like Directory.EnumerateFiles
which iterates file-by-file.
If you would like to contribute to the library, just submit a pull request.
Just a wild guess:
Probably it would be good to not get the whole thing into memory but use something like
Directory.EnumerateFiles
which iterates file-by-file.If you would like to contribute to the library, just submit a pull request.
okay. I'll build from source and have a look which paths are hot. i sure hope it isn't some pinvoke method, because then there would be no way to optimize i guess
Hm. I can't reference the project because it won't compile because it won't redownload the Microsoft.Net.Compilers.Toolset package - which version of VS are you using?
Maybe use some if/else to check whether a path is a long/short path and fall back to the .net Framework functions for these cases? (Assuming that those are faster)