Profiling DLL/LIB Bloat

前端 未结 8 2130
故里飘歌
故里飘歌 2020-12-29 00:46

I\'ve inherited a fairly large C++ project in VS2005 which compiles to a DLL of about 5MB. I\'d like to cut down the size of the library so it loads faster over the network

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-29 00:47

    All good suggestions. What I do is get the map file and then just eyeball it. The kind of thing I've found in the past is that a large part of the space is taken by one or more class libraries brought in by the fact that some variable somewhere was declared as having a type that sounded like it would save some coding effort but wasn't really necessary.

    Like in MFC (remember that?) they have a wrapper class to go around every thing like controls, fonts, etc. that Win32 provides. Those take a ton of space and you don't always need them.

    Another thing that can take a ton of space is collection classes you could manage without. Another is cout I/O routines you don't use.

提交回复
热议问题