我的 C# 程序应该每秒执行 30 次异步任务。
该程序作为独立的 Windows 应用程序运行良好。
但是当它在 Visual Studio 2013 Professional 环境中以 Debug模式运行时,性能非常差 - 每秒只有 5 个任务,即使代码中没有任何断点。
调试速度慢是 VS.Net 2013 的“特性”吗?有没有办法调试时间关键的 C# 应用程序?
最佳答案
感谢 user1720293 关于日志记录的想法。性能大幅下降的主要原因是通过 log4net.Appender.ConsoleAppender
登录到控制台。注释掉配置文件中的一行后问题就解决了
<root>
<level value="DEBUG"/>
<!-- here's the source of the problem
<appender-ref ref="ConsoleAppender"/>
-->
<appender-ref ref="RollingFile"/>
</root>
关于c# - 应用程序在 Debug模式下运行速度非常慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20466858/