Go 1.20 "cold start" slows down CI pipeline stages due to first building stdlib

158 views
Skip to first unread message

TheDiveO

unread,
Feb 16, 2023, 2:54:45 PM2/16/23
to golang-nuts
As Go 1.20 doesn't ship anymore with prebuild stlib packages, the first build after installation will take longer. Obviously, in a full Kubernetes build this is negligible (if not outward laughable). But for many small CI Go build stages this probably eats considerably into CPU time and energy consumption.

For instance, a small module https://github.com/thediveo/caps/actions/runs/4197604787 takes around 36s for Go 1.19 versus Go 1.20 with 63s (times for "go test" phase only).

Now I'm curious: is there some way to "preheat" Go 1.20 in order to cache the locally built Go stdlib?

Sean Liao

unread,
Feb 16, 2023, 3:30:22 PM2/16/23
to golang-nuts
- restore cache (go version as cache key)
- go build std
- save cache (GOCACHE)
- original build steps follow here

- sean

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e300c706-da67-4cb9-8a37-bf15bd041e7dn%40googlegroups.com.

TheDiveO

unread,
Feb 16, 2023, 3:31:25 PM2/16/23
to golang-nuts
Many thanks!
Reply all
Reply to author
Forward
0 new messages