If you're looking to speed up your FreeBSD kernel and world builds, try using the
WITH_META_MODE compile option and/or installing and enabling
ccache. Turning these on gave me a 30x speed boost for the buildworld and buildkernel process. That's not a typo. Compiling a complete kernel and world on my test machine used to take over 6 hours, even with
/usr/obj/ having been left intact from prior builds. My most recent build finished in just 13 minutes, or around 1/30th of the old time!
The WITH_META_MODE compile option takes advantage of the
filemon kernel module, creating and inspecting metadata about the objects compiled during a system build. New metadata files get stored in
/usr/obj alongside the object files they refer to. On subsequent builds, when the compiler goes to build an object, if nothing about the build command or its related files (headers, libraries, etc.) has changed, the cached object can be used instead...