4 ms·
Go is currently pretty fast, maybe half as fast as C. There is a new backend for the Go compiler being planned which uses more modern techniques. This plan[1]
by andrewchambers 12y ago
Go is currently pretty fast, maybe half as fast as C. There is a new backend for the Go compiler being planned which uses more modern techniques.
This plan[1] estimates at 10 percent speed improvements initially, I just think they will continue to progress further over time once the SSA framework is built. They will be able to port essentially every optimization llvm uses eventually, and add a few new ones that can rely on memory safety and pointer aliasing guarantees Go provides.
Go can also do whole program analysis with the ssa form because all source is present at build time.
An addition of a moving garbage collector may also improve cache locality. We will see, google cares about making servers efficient, as it saves money in power.
[1] https://docs.google.com/document/d/1szwabPJJc4J-igUZU4ZKprOrNRNJug2JPD8OYi3i1K0 https://docs.google.com/document/d/1szwabPJJc4J-igUZU4ZKprOr...
- rdtsc 12y agoThat makes sense Andrew, thanks for explaining.
- sinistersnare 12y agoWhat guarantees does Go provide about pointer aliasing? I have no production code in Go, but from what I have played with, Go has no way of indicating that a pointer is not aliased, so how can it optimize that, other than through static analysis, which will not catch the majority of cases. I ctrl-f'd "alias" on your paper that you linked, and no mention is shown. edit: in fact, I forgot to look for "escape analysis." So it does get mentioned, but only to point out that it is a non-goal of the project.
- andrewchambers 12y agoGo just guarantees different typed pointers don't alias, I think C has a flag to allow this assumption though.