不要.pdbs减慢发布应用程序? [英] Do .pdbs slow down a release application?

查看:162
本文介绍了不要.pdbs减慢发布应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果一个.PDB(程序调试)文件包含一个.dll再行号出现在抛出的异常的堆栈跟踪。这是否会影响应用程序的性能?

If a .pdb (program debug) file is included with a .dll then line numbers appear in the stack trace of any exception thrown. Does this affect the performance of the application?


这个问题是不是释放与调试,即最佳化。这是关于有.pdb文件对性能的影响。是.PDB文件中读取一个异常被抛出每一次?被缓存在某种程度上的信息被加载的程序集是什么时候?或者是缓存的第一次相关的异常被抛出?有多少区别呢?

This question is not about release vs. debug, i.e. optimisations. It is about the performance implications of having .pdb files. Are the .pdb files read every time an exception is thrown? Is the information cached in some way when the assemblies are loaded? Or is it cached the first time a relevant exception is thrown? How much difference does it make?

推荐答案

约翰·罗宾斯在他的文章写了一篇关于这个<一href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/19/do-pdb-files-affect-performance.aspx">Do PDB文件将影响性能?。简单的答案是否定的(如果您编译发布版本同时与/优化+和/调试开关):

John Robbins wrote about this in his article Do PDB Files Affect Performance?. The simple answer is no (if you compile your release build with both the /optimize+ and /debug switches):

这可能是真实的在其他操作系统上,而不是Windows。如果您认为他们这样做,那么为什么微软建立他们附带PDB文件打开的调试和发布版本的每一件单品?他们写的编译器,他们写的链接,他们写的操作系统,让他们知道到底是什么效果。微软有更多的人集中在性能上比任何其他的软件公司在世界上。如果有在所有任何性能影响,他们不会做。期。性能不是微软唯一的东西,它的一切。

That might be true on other operating systems, but not Windows. If you think they do, then why does Microsoft build every single product they ship with PDB files turned on for both debug and release builds? They wrote the compiler, they wrote the linker, and they wrote the operating system so they know exactly what the effects are. Microsoft has more people focused on performance than any other software company in the world. If there were any performance impact at all, they wouldn't do it. Period. Performance isn't the only thing at Microsoft, it's everything.

此外:

当建/优化+和一个/调试开关,DebuggingMode.IgnoreSequencePoints传递给DebuggableAttribute告诉JIT编译器,它不需要加载PDB文件,以便正确JIT与IL。

When built /optimize+ and a /debug switch, a DebuggingMode.IgnoreSequencePoints is passed to the DebuggableAttribute to tell the JIT compiler that it doesn't need to load the PDB file in order to correctly JIT the IL.

他还有另一个一篇题为<一个href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/11/pdb-files-what-every-developer-must-know.aspx">PDB文件:什么每个人都必须知道,这也是一个很好看的

He also has another article entitled PDB Files: What Every Developer Must Know that is also a good read.

这篇关于不要.pdbs减慢发布应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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