Billy ONeal
Billy ONeal

Reputation: 106539

Where can one find a profiler for reducing binary size on MSVC++/Windows?

I've got a lot of users who use dial up. Plus I'm paying for bandwidth. I'm interested in working on getting my app smaller to help on both these concerns; it sits at about 200k right now but it would be nice if it was in the 100-150k range.

However, I have no idea what constructs and locations in my binary are using the most size, which makes this difficult to tune for.

Does any free profiler exist which helps target binary size problems?

Upvotes: 4

Views: 1420

Answers (3)

Mark Ransom
Mark Ransom

Reputation: 308158

Visual Studio has an option to generate a map file which will show you the addresses assigned to each part of your program. In the project properties, Linker->Debugging->Generate Map File.

Upvotes: 3

Offirmo
Offirmo

Reputation: 19840

When I was developping in C/C++ for an embedded platform, I used to be able to see the linker's results, especially the sizes of the data/rodata/bss/code sections (see http://en.wikipedia.org/wiki/Data_segment if you don't understand those words) and then I could dive into a specific area to find the big elements.

By googling "code size optimization c++", I found an existing SO question : Reducing C++ code size which seems to speak exactly of what I mean : "avr-gcc generate a map file so you can look at it and see what is taking up so much space."

By googling "code size profiler c++ " I found this page about code size : http://www.murrayc.com/blog/permalink/2006/02/15/c-code-size/ with an interesting comment than leads to DWARF utilities which could be able to do that too : http://reality.sgiweb.org/davea/dwarf.html

Now it's your turn to dive into those results ! Good luck !

Upvotes: 3

fsaintjacques
fsaintjacques

Reputation: 476

GCC provides an option (-Os) for size reduction, see gcc(1). Not sure if Visual Studio provides something similar.

I'm also guessing you're already shipping compressed binaries to your clients.

Upvotes: 1

Related Questions