Break down C++ code size

前端 未结 7 1910
心在旅途
心在旅途 2021-02-04 10:51

I\'m looking for a nice Stack Overflow-style answer to the first question in the old blog post C++ Code Size, which I\'ll repeat below:

I’d

7条回答
  •  南方客
    南方客 (楼主)
    2021-02-04 11:32

    If you're looking to find sources of code bloat in your C++ code, I've used 'nm' for that. The following command will list all the symbols in your app with the biggest code and data chunks at the top:

    nm --demangle --print-size --size-sort --reverse-sort  | less
    

提交回复
热议问题