mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.84k stars 1.02k forks source link

Improve FileNesting performance by avoiding costly IO #9451

Closed iantoalms closed 4 years ago

iantoalms commented 4 years ago

Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1034938

Given the current FileNesting logic, we check for a potential parent which matches a filepath spec. We filter out these parents if they are directories using FilePath.IsDirectory, which causes IO via Directory.Exists. As we already know whether a filepath in the project filelist is a directory, we should delay this filtering and avoid the IO.

Testing:

This change has a 2x speedup (~2.5mins to ~1.1min) for a React.js & Redux Asp.Net Core project which has a node_modules folder added to the project.

iantoalms commented 4 years ago

@monojenkins backport release-8.4