2 ms·
The main thing is, that they machine translated the Go compiler itself from C to Go, so the compiler had not so great Go code. The rest of the runtime probably
by _ph_ 10y ago
The main thing is, that they machine translated the Go compiler itself from C to Go, so the compiler had not so great Go code. The rest of the runtime probably was already human-written in Go before that. And of course, anything which has been under development since then is human written, like the new SSA-based compiler.
- EdiX 10y agoThe rest of the runtime probably was already human-written in Go find -name '*.X' | xargs wc -l in src/runtime says Go 1.4: 21701 .c 33348 .go 19160 .s Go 1.7b2: 3340 .c 77597 .go 33827 .s The assembly growth seems to be attributable to the increased number of supported platforms
- 4ad 10y agoYou should exclude runtime/cgo, since it's not relevant.
- giovannibajo1 10y agoThere's also an increased number of optimized code-paths, like for instance some crypto code in the TLS stacks. The natural way to optimize Go code, for instance to benefit from advanced CPU instructions in modern architectures, is to fallback to assembly.