Is there a “function size profiler” out there?

后端 未结 5 1181
时光说笑
时光说笑 2021-01-31 21:40

After three years working on a C++ project, the executable has grown to 4 MB. I\'d like to see where all this space is going. Is there a tool that could report what the biggest

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 22:10

    I could not get nm to work for me but did manage to find a useful tool called Sizer. It reads the debug information created by Visual Studio using the Debug Interface Access libraries. It's pretty straightforward to use, as describe on the site.

    1. Compile with debugging info in program database (.pdb) file
    2. Run sizer from command line e.g. Sizer.exe . The output will go to stdout so you'll probably want to redirect to a file.

    The code sizes are broken down in different sections and grouped by function, data, class, etc, each section sorted in descending order of code size.

提交回复
热议问题