mono / monodevelop

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

[release-8.4] Improve FileNesting performance by avoiding costly IO #9454

Closed monojenkins closed 4 years ago

monojenkins 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.

Backport of #9451.

/cc @iantoalms