4 ms·
> Our largest micro service written in Go currently takes 6 seconds to compile. What's the biggest, beefiest real world program yet written in Go, and how long
by jancsika 9y ago
> Our largest micro service written in Go currently takes 6 seconds to compile.
What's the biggest, beefiest real world program yet written in Go, and how long does it take to compile it?
- kevinconaway 9y agoTwo large projects that I know of are CockroachDB and Influxdb A quick glance seems to indicate that cockroachdb takes about 9 minutes [1] and infuxdb about 15 minutes [2] [1] https://teamcity.cockroachdb.com/viewLog.html?buildId=380603&tab=buildResultsDiv&buildTypeId=Cockroach_MergeToMaster https://teamcity.cockroachdb.com/viewLog.html?buildId=380603... [2] https://circleci.com/gh/influxdata/influxdb/tree/master https://circleci.com/gh/influxdata/influxdb/tree/master
- teraflop 9y agoThat build log for CockroachDB takes a lot longer than a normal build, because it's generating releasable artifacts for multiple platforms, which means running the entire build process multiple times. Also, the build time is dominated by a few vendored C++ dependencies (mainly libprotobuf and libsnappy) which are built using CMake. On my system, building just the Go code for the latest version of CockroachDB (about 360kloc) takes 24 seconds.
- btym 9y agoDocker takes about 10m to build: https://jenkins.dockerproject.org/job/docker/job/docker.github.io/job/master/1606/ https://jenkins.dockerproject.org/job/docker/job/docker.gith... Kubernetes takes about 16m: https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-bazel-build/223299/ https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/...
- takeda 9y agoDoesn't sound too fast, that's about how long it takes for FreeBSD kernel to be compiled[1] and I would imagine a kernel is more complex. The whole system takes about 50 minutes[2] [1] https://ci.freebsd.org/job/FreeBSD-head-amd64-LINT/buildTimeTrend https://ci.freebsd.org/job/FreeBSD-head-amd64-LINT/buildTime... [2] https://ci.freebsd.org/job/FreeBSD-head-amd64-build/buildTimeTrend https://ci.freebsd.org/job/FreeBSD-head-amd64-build/buildTim...
- cdoxsey 9y agoGo's main compilation performance gains come from incremental compilation. Since C++ doesn't have real module support merely parsing the entire dependency graph from headers can take a very long time. In go if you have .a pkgs for all your dependencies your program will compile very fast. If you use docker as part of your ci build the dependencies as a separate step so they can be cached between builds. This is especially important for libraries like sqlite, which can take a lot longer to compile.
- tapirl 9y agoOn a not-too-old notebook, building k8s needs less than one minute.
- Liquid_Fire 9y ago> Docker takes about 10m to build: https://jenkins.dockerproject.org/job/docker/job/docker.gith.. https://jenkins.dockerproject.org/job/docker/job/docker.gith.... That seems to be docker.github.io, the Docker documentation, not Docker itself (and not written in Go).
- squiguy7 9y agoBuilding pure go applications can be speedy but as soon as you introduce cgo, you can expect these times to inflate pretty significantly.