Bread
Bread

Reputation: 443

How do i look at the optimizations the compiler has made

Is there a built in way to look at the optimizations the go compiler has made or the code generated by the go compiler, for example how do I know if a function was made inline?

Upvotes: 2

Views: 75

Answers (1)

Roland Illig
Roland Illig

Reputation: 41686

To see the generated code:

go tool objdump myprogram.exe

go tool objdump -s "\.String" myprogram.exe

The latter command only disassembles all String functions.

Upvotes: 4

Related Questions