Improve collaborative build times with ccache
By Martin C. Brown2004-11-08
Statistics
Now that everything is set up, it is time to see how much of a difference it makes. I've run a series of tests here building Perl. We need something meaty to compile, because ccache works best when it has cached the parsed header files. This is just the make phase, which occurs after we've run a standard configure (using configure.gnu), and it includes all the stages, even those not related to compiling code. These non-compiler operations won't affect the overall statistics.
As previously mentioned, the effects of ccache won't be felt on the first compilation. It's the recompilation, where you are reusing previous preprocessor passes, that will make a difference. The recompile times in Table 1 are based on simply doing a touch on each of the C source files in the main Perl source directory. I've included the times for building with plain gcc, ccache+gcc, and ccache+distcc+gcc in a four-node network with various values of concurrent distcc jobs.
Table 1. The recompile times
Environment Time
gcc (first run) 8m02.273s
gcc (recompile) 3m30.051s
ccache+gcc (first run) 8m54.714s
ccache+gcc (recompile) 0m45.455s
ccache+distcc+gcc -j4 4m14.546s
ccache+distcc+gcc -j4 (recompile) 0m38.985s
ccache+distcc+gcc -j8 3m13.020s
ccache+distcc+gcc -j8 (recompile) 0m34.380s
Wow! Just using ccache alone saves almost 3 minutes (well, 2 minutes and 45 seconds) on the build time of Perl, all because ccache has kept pre-parsed versions of the header files and used them in place of continually re-running cpp on each source file. Incorporating distcc into the process gives results in an overall speed increase as well as slightly faster recompile times.
Tutorial Pages:
» How to squeeze more speed out of your compilations
» Using ccache
» Combining ccache and distcc
» Statistics
» Summary
» Resources
First published by IBM DeveloperWorks
| Related Tutorials: » How to Install PHP 5 on Linux » How to Install Apache 2 on Linux » How to Install MySQL 5.0 on Linux » SMB Caching » Mound --Bind » Tar Wild Card Interpretation |
