这个问题不是关于版本与调试,即优化.关于具有.pdb文件的性能影响.每次抛出异常时,是否读取.pdb文件?加载程序集时,信息是否以某种方式缓存?还是第一次缓存相关的异常?它有多大的区别?
解决方法 John Robbins在他的文章 Do PDB Files Affect Performance?中写道.简单的答案是否定的(如果您使用/ optimize和/ deBUG开关来编译发行版)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.
另外:
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.
他还有另一篇题为PDB Files: What Every Developer Must Know的文章也是一个很好的阅读.
总结以上是内存溢出为你收集整理的c# – 执行.pdbs减缓发布应用程序?全部内容,希望文章能够帮你解决c# – 执行.pdbs减缓发布应用程序?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)