user997112
user997112

Reputation: 30655

View the size of instructions generated after compiling C++?

Its easier if I tell you why I am asking this- in case I do not ask the correct question. When inlining functions you can sometimes make the code too big and therefore cause TLB misses. I also believe you would end up with not L1 data, but L1 instruction cache misses if you use inlined code too much.

How can one determine how large their compiled assembly/machine code is after compiling? Is it possible to measure it?

Upvotes: 0

Views: 147

Answers (1)

Jerry Coffin
Jerry Coffin

Reputation: 490728

Most compilers will generate assembly language output with the right incantation (e.g., -Fa for VC++, -S for most others).

VC++ can also produce a map file, which is often easier to sort things out from -- it's produced by the linker, so it includes things like link-time optimization and tells you the addresses of symbols. Since it's how the symbols are laid out in the executable, the difference between successive addresses will tel you the size of each (after padding).

Upvotes: 1

Related Questions