Do .pdbs slow down a release application?

后端 未结 2 1594
梦如初夏
梦如初夏 2021-01-02 01:59

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 applicati

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-02 02:39

    Not normally. PDBs and optimizations are orthogonal. One can be enabled regardless of the value of the other option. However, it might reduce performance if you want to actually use the information contained in PDB, like when you are accessing the StackTrace of an exception and it needs to get line numbers from PDB or when you call new StackTrace(true).

    By the way, Eric Lippert has a related blog entry about compiler optimizations.

提交回复
热议问题