dll大小(调试和发布)
我在其他讨论中读到,与调试 dll 相比,Release dll 的大小减小了。 但为什么我制作的dll大小却相反:Release dll比Debug dll大。 会引起问题吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
它不会引起问题,可能是编译器在发布版本中“内联”更多项目并创建更大的代码。 这一切都取决于代码本身。
完全不用担心。
编辑:
如果您真的担心而不担心速度,您可以打开优化大小。 或者关闭自动内联,看看有什么不同。
编辑:
更多信息,您可以使用 dumpbin /headers 来查看 dll 变大的位置
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你的Release DLL 比你的Debug DLL 大多少?
当您生成 PDB 符号文件时,您的调试 DLL 可能看起来很小(因此调试符号实际上不在 DLL 文件中)。 或者,如果您无意中将调试符号编译到发布 DLL 中。
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.
这可能是由循环展开等性能优化引起的 - 如果明显不同,请检查您的发布链接器设置以确保您没有静态编译任何内容。
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.
如果您的应用程序执行高性能任务,则性能可能会受到影响。 如果标记了生成包含调试信息的代码的选项,则发布版本甚至可以大于调试版本。 但这也取决于您使用的编译器。
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.