3 ms·
Similarly, you can turn off bounds-checking in Go like this: go build -gcflags=-B and see if it helps. Generally the assembly looks better, but it doesn't r
by bugfix-66 4y ago
Similarly, you can turn off bounds-checking in Go like this:
go build -gcflags=-B
and see if it helps. Generally the assembly looks better, but it doesn't really run faster on a modern chip.
Do your own test, and keep the results in mind next time somebody on Hacker News dismisses Go because of the "overwhelming cost of bounds checking".
- masklinn 4y ago> next time somebody on Hacker News dismisses Go because of the "overwhelming cost of bounds checking". That’s certainly one criticism I don’t remember ever seeing.
- viraptor 4y agoThere's a few examples like this https://news.ycombinator.com/item?id=32256038 https://news.ycombinator.com/item?id=32256038 if you search comments for "go bounds checking"
- pjmlp 4y agoIt appears that the flag keeps being undocumented, though. https://pkg.go.dev/cmd/compile https://pkg.go.dev/cmd/compile