Speeding up cgo builds

kena edited this page Jun 8, 2016 · 10 revisions

The go tool is used to build all of the CockroachDB source, including C and C++ dependencies via the cockroachdb/c-{rocksdb,snappy,protobuf} packages. Unfortunately, go build does not parallelize building of source files within a package. For .go files this isn't a problem because the Go compiler is fast. For C and C++ files the issue is more noticeable. Compiling the c-rocksdb package takes ~2min on my machine. Parallelizing the compilation of C and C++ files by go build reduces the build time to 30sec. If you frequently edit any of the cockroachdb/c-* packages and you're comfortable running a hacked version of the go tool, this patch is for you:

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.