Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSpeeding up cgo builds
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.
Find the latest version in the build directory of the main cockroach repository. For OSX, use homebrew-go.