Slow “Find All References” in Visual Studio

随声附和 提交于 2020-01-05 06:18:28

问题


I have a VS solution that contains 6 library projects and 1 web folder project.

When I try to use the "Find All References" feature on an object or method, it takes more than 6 minutes to finish !

It seems to be refactoring every aspx & ascx file of the web project.

Any idea on how to make it faster ?


回答1:


You didn't mention which version of Visual Studio you are running, but I found a blurb that claims they did some performance improvements between 2005 and 2005SP1

We made a change in the VS2005 SP1 (and included it in VS 2008) which optimizes performance in web projects by first performing a lexical search of the element being refactored to determine if the page needs to be loaded. I apologize for it taking us so long to update this issue with the resolution; there were several connect bugs that were related and while we updated most we managed to miss some.

We expect that in the future we'll do even more performance enhancements for this scenario (post VS 2008), but hopefully the optimizations we have done drastically increase performance in most cases.

Also, this solution kinda sucks, but MS offered this workaround too:

With respect to workarounds you can increase the performance fairly significantly if you open all of the web pages prior to performing the refactoring. I agree that it isn't a particularly good workaround, but for VS 2005 we chose to prioritze correctness over performance for refactoring.

Source: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=92239




回答2:


That does seem slow, I have a solution with 276 projects (don't ask) and it takes less than six minutes to find references.

I started using Source Insight and found it much quicker.

Another thought, your virus checker might be interfering. Sysinternals filemon or procexp would confirm.




回答3:


I would try deleting out all your ncb files, these files sometimes get corrupted and can have many wide ranging effects. Since your feature is using them it might help, they will be automagically regenerated next time you open your solution



来源:https://stackoverflow.com/questions/428436/slow-find-all-references-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!