Hacker News new | past | comments | ask | show | jobs | submit login
Go 4x faster: wrap your existing tight loops in functions till a compiler fix (github.com/golang)
26 points by reportaman 8 months ago | hide | past | favorite | 5 comments



"I think this is a consequence of variables being sent to a channel effectively having their address taken, disabling register allocation for them."

Looks like the Go code generator and optimizer is absolutely terrible, since any reasonable optimizer has standard optimizations that prevent this.

Apparently they wrote their own rather than using something established like LLVM, and this is the result.


> Apparently they wrote their own rather than using something established like LLVM, and this is the result.

Go is self-hosted, and compilation is much faster than any LLVM-based compiler I know. Those are valuable properties. We can argue about how valuable, but it's not nearly as simple as a case of NIH as you're implying.


It's seems like we are treading old ground


Please post a link here.


Shows go compiler still has perf tuning to be done, and language might see decent speedup in applications where tight loops matter.




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

Search: