ccache for a 5 minute LibreOffice build!ccache for a 5 minute LibreOffice build
If you have ever tried to build LibreOffice code, you know that it can take a lot of time. LibreOffice has ~6 million lines of C++ and some Java code (<280k). But, there are tools that can help you build LibreOffice from source code much faster, if you do it repeatedly! Here I discuss how.
Even with a fast computer, compiling huge amount of C/C++ code takes a lot of time. Compiling 6 million lines of C/C++ code in LibreOffice will take you several minutes (if not hours) with a decent computer with fast CPU and a lot of RAM.
But, people who work on developing LibreOffice need to build it from the source repeatedly. Because only a fraction of the code changes each time, there is a big chance that one can re-use the compiled objects, and that’s where ccache (and similar tools) come in. It caches the compiled objects, and before trying to re-compile the code, searches inside the cache to see if a previously compiled objects are usable.