The latest release of the Go language, Go 1.15, focuses on improving the toolchain, runtime, and core libraries. Besides improving the linker and allocation for small objects, Go 1.15 deprecates X.509 CommonName, supports a new embedded tzdata package, and more.

Go linker changes aim to reduce memory and CPU time usage as well as to improve code robustness and maintainability.

For a representative set of large Go programs, linking is 20% faster and requires 30% less memory on average, for ELF-based OSes (Linux, FreeBSD, NetBSD, OpenBSD, Dragonfly, and Solaris) running on amd64 architectures, with more modest improvements for other architecture/OS combinations.

The improvements were made possible by re-designing the object file format and increasing the linker internal concurrency. These changes are actually only the first outcomes of a multi-release effort to modernize the Go linker which will mostly benefit large-scale systems built in Go. As a matter of fact, the Go linker was originally written in C and semi-automatically converted to Go syntax, which makes it likely not the most optimized component in Go toolchain. In addition, its design remained unchanged in spite of the growth of the language and of the systems built with it.

There are features of Go that make it amenable to very efficient linking algorithms, none of which we take advantage of right now. Go also controls its object file format, giving us the opportunity to innovate and co-design the compiler, object format, and linker.

#system programming #go language #google #cloud #development #news

Go 1.15 Improves the Go Linker, Small Object Allocation, and More
1.20 GEEK