简体   繁体   English

在VS2010中进行调试会导致性能下降

[英]Debugging in VS2010 causes performance lag

VS2010 Performance Issues VS2010性能问题

I've been having a problem with Visual Studio creating lag whilst debugging. 我在Visual Studio调试时出现滞后问题。 The problem occurs during a game I've written where, when you shoot it creates about a second of lag. 问题发生在我写过的游戏中,当您射击游戏时,会产生大约一秒钟的延迟。 Weirder still, I wrote this same program before and the lag didn't exist, very few things have changed in my new program. 还是很奇怪,我之前也写过同样的程序,但滞后并不存在,在我的新程序中几乎没有什么变化。

The ultimate weirdness is that when I do a performance profile, it suddenly works awesome. 最终的怪异之处是,当我执行性能配置文件时,它突然变得很棒。 Ditto if you go into the solution directory and launch either the debug or release version directly. 如果您进入解决方案目录并直接启动调试或发布版本,则同上。 Anyone know why this is happening? 有人知道为什么会这样吗? I can't work on my game until it's resolved. 在解决之前,我无法进行游戏。 :( :(

Computer Specs: 电脑规格:

OS: Windows 7 Home Premium 64-bit 操作系统:Windows 7 Home Premium 64-bit

CPU: Intel Core i5 3570K 处理器:Intel Core i5 3570K

RAM: 8.00 GB Dual-Channel DDR3 @ 665MHz (9-9-9-24) 内存:8.00 GB双通道DDR3 @ 665MHz(9-9-9-24)

MoBo: ASRock H61M-HVS MoBo:华擎H61M-HVS

Visual Studio: 视觉工作室:

Version: Ultimate SP1 版本:Ultimate SP1

Extensions: Resharper, .Net Demon, VS10X Code Map, FxCopRunner, Indent Guides, Power Commands, Productivity Power Tools. 扩展:Resharper,.Net Demon,VS10X代码映射,FxCopRunner,缩进指南,电源命令,生产力电动工具。

EDIT: The issue was occuring around a bit of code I use to parse XML files. 编辑:问题发生在我用来解析XML文件的一些代码周围。 The issue was that I overused try-catch and it caused considerable lag. 问题是我过度使用try-catch,这导致了相当大的延迟。

If your code throws many exceptions which are caught, VS2010+ (.NET 4) will be very slow with debugging compared to VS2008 (.NET 3.5). 如果您的代码抛出许多被捕获的异常,则与VS2008(.NET 3.5)相比,VS2010 +(.NET 4)的调试速度将非常慢。 This is known issue. 这是已知问题。

This is more likely to happen when debugging unit tests that are heavy on exception testing. 当调试大量异常测试的单元测试时,更可能发生这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM