简体   繁体   English

Visual Studio Profiler与发布模式-有什么区别?

[英]Visual Studio Profiler vs. Release Mode - what is the difference?

I am using WinForms, Visual Studio 2013, .Net 4.5 我正在使用WinForms,Visual Studio 2013,.Net 4.5

When running my application through the Visual Studio Profiler, it works exactly the way it should and when running it through either Debug or Release mode, I face horrible freezing and repainting issues. 通过Visual Studio Profiler运行应用程序时,它的运行方式与应有的方式完全相同,并且通过调试或发布模式运行它时,我面临着可怕的冻结和重绘问题。

What is the difference between running your application in the Visual Studio Profiler vs. running in through the Release Mode? 在Visual Studio Profiler中运行应用程序与通过发布模式运行应用程序之间有什么区别?

Thank you in advance 先感谢您

Finally found the answer here: Why does my program run way faster when I enable profiling? 终于在这里找到了答案: 启用概要分析后,为什么我的程序运行得更快?

When you run your application within Visual Studio, the debugger is attached to it. 当您在Visual Studio中运行应用程序时,调试器将附加到它。 When you run it using the profiler, the debugger is not attached. 使用事件探查器运行它时,未附加调试器。

If you press F5 to run your program, even with the Release build, the debugger is still attached. 如果您按F5键运行程序,即使使用Release版本,调试器仍将连接。

Since I was running my application through Visual Studio, I was seeing some really strange behavior such as slow repainting, freezing, etc. - I spent days chasing the usual suspects, double buffering, not invoking calls from background threads, missing locks, etc. and it turns out I was chasing a bug that wasn't there on a first place. 自从我通过Visual Studio运行应用程序以来,我看到了一些非常奇怪的行为,例如重新绘制缓慢,冻结等。-我花了几天时间追逐通常的可疑对象,双缓冲,不从后台线程调用调用,缺少锁等。原来,我是在追赶最初没有的错误。 Hope this saves someone hours or headache. 希望这可以节省一些时间或头痛。

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

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