Why does creating pdb files increase the size of my native C ++ exe?

Just by enabling Configuration> Linker> Debugging> Generate Debug Info properties, the size of my exe increased from 2.11MB to 2.34MB

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

  • I also saw that Configuration Properties> C / C ++> General> Debug Information Format is disabled in release mode, while pdb files are configured to generate, is there any reason why this would be? From what I can tell, exe is the same size - it’s just a PDB that gets bigger when you turn on the program database, I don’t see a problem with this, but I want to make sure that there is no part, is missing, considering that the program database is the standard for new projects in the release configuration.

+7
source share
3 answers

The increase in executable file size is probably due to the compiler, including code that would otherwise be optimized. Try contacting / OPT: REF and see if the size has been reduced to what it was.

In terms of performance, this should not be significant. Bloating can cause code caching to be less efficient, but in most cases this will be negligible.

+2
source

The size of the exe is probably completely unrelated to performance.

0
source

Not only the path to the PDB file, but also the "Debug" in the header of the executable image, the internal GUID to ensure the correct PDB file is loaded during debugging / debugging.

0
source

All Articles