为什么生成pdb文件会增加我的本地C ++ exe的大小? [英] Why does generating pdb files increase the size of my native C++ exe?

查看:280
本文介绍了为什么生成pdb文件会增加我的本地C ++ exe的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需打开配置属性>链接器>调试>生成调试信息,我的exe的大小从2.11MB增加到2.34MB

Just by turning on Configuration Properties > Linker > Debugging > Generate Debug Info the size of my exe has increased from 2.11MB to 2.34MB


  1. 什么是额外的〜230KB用于?我认为exe应该大致相同的大小(给或采取一个额外的路径pdb文件),但不是那么多。

  1. What is that extra ~230KB being used for? I thought the exe should be roughly the same size (give or take an extra path to the pdb file) but not that much. Would there be any performance hit from this "bloat"?

我还看过配置属性> C / C ++>常规>调试信息格式在发布模式下设置为禁用,而pdb文件设置为生成,有什么原因吗?从我可以告诉的exe是相同的大小 - 它只是PDB越来越大,当你启用程序数据库,我看不到这个问题,但我想确保没有一些,我

I've also seen Configuration Properties > C/C++ > General > Debug Information Format set to disabled in release mode while the pdb files are set to generate, is there any reason why this would be? From what I can tell the exe is the same size - it's just the PDB that gets bigger when you enable Program Database, I can't see a problem with this but I want to make sure there isn't some piece that I'm missing considering Program Database is the default for new projects in the release configuration.


推荐答案

p>可执行文件的大小的增加可能是由于编译器包括否则将被优化的代码。尝试与 / OPT:REF 链接,并看看是否会将大小降低到原来的大小。

The increase of size of the executable is probably due to the compiler including code that would have otherwise be optimized away. Try linking with /OPT:REF, and see if that drops the size back to around what it was.

至于性能损失,它不应该是显着的。膨胀可能导致代码的缓存效率较低,但在大多数情况下,这是可以忽略的。

As for the performance hit, it should not be significant. The bloat might cause caching of code to be less efficient, but on most cases that would be neglectable.

这篇关于为什么生成pdb文件会增加我的本地C ++ exe的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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