dll size (debug and release)

两盒软妹~` 提交于 2019-12-22 07:57:32

问题


I have read in other discussions that Release dlls have reduced size compared to Debug dlls. But why is it that the size of the dll I have made is the other way around: the Release dll is bigger than the Debug dll. Will it cause problems?


回答1:


It won't cause problems, its probably that the compiler is 'inlining' more items in the release build and creating larger code. It all depends on the code itself.

Nothing to worry about.

EDIT: If you are really worried about and not worried about speed you can turn on optimize for size. Or turn off auto inlining and see what difference you get.

EDIT: More info, you can use dumpbin /headers to see where the dll gets larger




回答2:


How much bigger is your Release DLL than your Debug DLL?

Your Debug DLLs might seem small is you are generating PDB symbol files (so the debug symbol is not actually in the DLL file). Or if you are inadvertently compiling debug symbols into your Release DLL.




回答3:


This can be caused by performance optimizations like loop unrolling - if it's significantly different, check your Release linker settings to make sure that you're not statically compiling anything in.




回答4:


The performance can be influenced if your application perform tasks of high performance. A release version can even be larger than a debug version, if marked options to generate code with information on Debug included. But this also depends on the compiler you are using.



来源:https://stackoverflow.com/questions/535066/dll-size-debug-and-release

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!