我如何看待编译器进行的优化
问题描述:
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?
是否有内置的方法来查看go编译器进行的优化或go编译器生成的代码 ,例如,如何知道是否将函数内联? p> div>
答
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.