开发者

Given a dll/exe (with or without .pdb), can I see what .obj files contribute to its size and how much?

开发者 https://www.devze.com 2023-04-05 16:08 出处:网络
I compiled a dll file with a whole bunch o开发者_开发技巧f cpp files. I want to see how much each cpp contributes to the final size of the dll, in order to cut down its size (say by excluding some lib

I compiled a dll file with a whole bunch o开发者_开发技巧f cpp files. I want to see how much each cpp contributes to the final size of the dll, in order to cut down its size (say by excluding some libraries). Is there any way to do that? Thank you!


This ranges from quite difficult (which object do you charge library functions against) to impossible (when whole program optimization is used to inline across compilation unit boundaries).

I also suggest that it's not very useful. You need to know which functions to target for slimming down, not just which files.

Generating a map file during the build (pass /MAP to LINK.EXE) is probably the best you can do. The documentation also mentions something about symbol groups, which you might be able to use to your advantage as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号