应用程序缓慢 - Visual Studio 2015:如何找到昂贵的方法/功能(最耗时)

时间:2016-05-22 14:09:04

标签: debugging sharepoint visual-studio-2015 performance-testing visual-studio-debugging

我有一个庞大而复杂的SharePoint 2013解决方案,并且在我的开发计算机上安装了Visual Studio 2015。该应用程序非常慢,在Internet Explorer中打开需要大于20秒。现在我想找出我的代码的哪一部分是需要这么长时间的部分。通过逐步完成代码,我无能为力,因为它是一个非常大的项目。我该怎么做才能找到这个?

1 个答案:

答案 0 :(得分:0)

我已使用SharePoint Developer Dashboard并使用SPMonitoredScope解决了我的问题。通过这个,我能够看到哪些方法/功能被调用,以及在哪个频率以及消耗了多少时间。

using (new SPMonitoredScope("My Scope Name"))
{
   doSomeWork(); 
}