Visual Studio 2015调试器 - 对SqlCommand的高性能影响 [英] Visual Studio 2015 debugger - high performance impact on SqlCommand

查看:195
本文介绍了Visual Studio 2015调试器 - 对SqlCommand的高性能影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从VS2013升级到VS2015后,我感到震惊的是我的Web应用程序在连接调试器的情况下运行的速度有多慢。因此,我决定使用
有趣的是,在使用VS2013进行调试时,页面在IIS下加载速度比IIS Express快。但是在VS2015中调试时,IIS比IIS Express慢。



此外,MiniProfiler指示在SQL相关代码中使用了大部分时间。所以我尝试使用



在VS2015中进行调试时,似乎在SqlCommand.ExecuteReader()上花费了很高的CPU时间(实时),而没有附加调试器,该方法非常有效。



我是还在另一台具有相同结果的计算机上对此进行了测试。



我的应用程序使用ASP.NET MVC,NHibernate,SQL Server 2014,我正在使用IIS 10



是否有其他人在连接VS2015调试器时遇到应用程序性能下降,特别是在运行SQL命令时?任何想法的根本原因是什么以及如何解决它?

解决方案

可能是 IntelliTrace ,试试这个 https://msdn.microsoft.com/ en-us / library / dd264948(v = vs.100).aspx


After upgrading from VS2013 to VS2015, I was shocked by how slow my web application runs with the debugger attached. So I decided to do a comparison between VS2013 and VS2015 using MiniProfiler to analyze a particularly slow page:

Interestingly, when debugging using VS2013, the page loads faster under IIS then IIS Express. But when debugging in VS2015, IIS is way slower then IIS Express.

Also, MiniProfiler is indicating that a high proportion of the time is used in SQL-related code. So I tried using dotTrace to profile the page on IIS - once with the VS2015 debugger attached, and once without it attached:

It appears that when debugging in VS2015, a very high percentage of CPU time (real time) is spent on SqlCommand.ExecuteReader() whereas with the debugger not attached, that method is pretty efficient.

I've also tested this on another computer with the same results.

My application uses ASP.NET MVC, NHibernate, SQL Server 2014, and I'm using IIS 10

Has anybody else experienced slow application performance with the VS2015 debugger attached, particularly when running SQL commands? Any ideas what the root cause is and how to solve it?

解决方案

Could be the IntelliTrace, try this https://msdn.microsoft.com/en-us/library/dd264948(v=vs.100).aspx

这篇关于Visual Studio 2015调试器 - 对SqlCommand的高性能影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆