Tired of those slow compiles? Thanks to Kiasyn, I was made aware of a new tool that should help with this problem immensely. It's called ccache. What it does basically is caches the results of compiling source code so that the next time it's called on it gets processed alot faster. Compile times are reduced dramatically. More details available here: http://www.debian-administration.org/articles/129
Obviously in order for this to be effective, your server must have the ccache package installed ( mine do ).
Best illustrated with an example. This is done on the AFKMud 2.0 C++ code which is still being worked on, but I think it clearly demonstrates the power of this tool:
Test run on single CPU system running Fedora Core 4 with 768MB RAM
Before
time make clean
[Compiler spam removed]
real 2m51.428s
user 2m36.798s
sys 0m10.317s
After
time make clean
[Compiler spam removed]
real 0m11.418s
user 0m8.641s
sys 0m2.260s
How to use it
So how do you use this? It's very simple. Somewhere in your Makefile there should be a line like this:
It may specify gcc instead if you're compiling C. To use the cache, simply change it to this:
The first time you run a clean make, it populates the cache so the compile time will be about normal. But after that is when you can expect to see huge speed boosts from it.
Obviously in order for this to be effective, your server must have the ccache package installed ( mine do ).
Best illustrated with an example. This is done on the AFKMud 2.0 C++ code which is still being worked on, but I think it clearly demonstrates the power of this tool:
Test run on single CPU system running Fedora Core 4 with 768MB RAM
Before
time make clean
[Compiler spam removed]
real 2m51.428s
user 2m36.798s
sys 0m10.317s
After
time make clean
[Compiler spam removed]
real 0m11.418s
user 0m8.641s
sys 0m2.260s
How to use it
So how do you use this? It's very simple. Somewhere in your Makefile there should be a line like this:
CC = g++
It may specify gcc instead if you're compiling C. To use the cache, simply change it to this:
CC = ccache g++
The first time you run a clean make, it populates the cache so the compile time will be about normal. But after that is when you can expect to see huge speed boosts from it.