Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    go build -gcflags -m
After some quick googling I can't find what the "m" flag does. Can anyone shed some light?


  go build -gcflags
If you run `go help build`, you will see:

  -gcflags 'arg list'
		arguments to pass on each 5g, 6g, or 8g compiler invocation.
Then you can run:

  go tool 6g
And see:

  -m	print optimization decisions


Author of the article here

It helps in finding out details of what the compiler (Xg) thinks of various funcs inlining applicability (is that even a word?)


Speaking of gcflags, did you try Go with gcflags=-B to see how it performs without bounds checking.

I know this isn't 'the right way' given that Go is supposed to be a safe language but it would be interesting to see how much difference it would make.


Have not tried that... will give it a shot

But I guess we are then going away from idiomatic Go


I guess, it's an unsupported compiler option (as in it can disappear any new release).

I looked at it more as an option for when you want to cram out possible extra performance of release builds.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: