Google's Go language takes on compilation speed

Slower compilation times have hindered the language since 2015, when the language's compiler was translated from C to Go

Google's Go language takes on compilation speed
Credit: Deavmi

Google's open source Go language will improve compilation time with the planned version 1.8 upgrade.

Detailing planned tool chain improvements to Go, contributor Dave Cheney said the 1.8 release, due in February, is projected to improve compilation by an average of 15 percent over Go 1.7. This would help with increased compile times, which have dogged Go lately.

"Since Go 1.5, released in August 2015, compile times have been significantly slower than Go 1.4," Cheney said. "Work on addressing this slowdown started in earnest in the Go 1.7 cycle and is still ongoing." This predicament emerged after the compiler was translated from C to Go.

To improve compilation, the language's parser is being rewritten to make it faster and remove many package level variables inherited from the previous yacc parser. "This parser produces a new abstract syntax tree while the rest of the compiler expects the previous yacc syntax tree," Cheney said. "For 1.8, the new parser must transform its output into the previous syntax tree for consumption by the rest of the compiler." While the parser carries with it an extra transformation step, it is no slower than the previous version; this transformation requirement should be removed in Go 1.9, Cheney said.

To boost code generation, the SSA back end now supports more architectures; it had been rolled out for Intel 64 in Go 1.7. "AMD64, by virtue of being the most popular production architecture, has always been the fastest," said Cheney. Results comparing Go 1.8 to Go 1.7 on Intel architectures show middling improvement driven equally by improvements to code generation, escape analysis improvements, and optimizations to the standard library, according to Cheney. Go 1.8 also will support the 32-bit Mips platform, which was not supported in Go 1.7, and will feature reduced overhead when using the defer statement, which defers the execution of a function until the surrounding function returns.

Go, perhaps best known for its use in development of the Docker container platform, has been a rising star in language popularity.

To comment on this article and other InfoWorld content, visit InfoWorld's LinkedIn page, Facebook page and Twitter stream.
From CIO: 8 Free Online Courses to Grow Your Tech Skills
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.