Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Every time I compile my code in GCC it takes about a minute. What is the best way to speed this up? Should I just buy a newer faster computer?

share|improve this question
    
Speeding up the bottlenecks on your machine (presumably CPU and memory for a compiler unless it's caching everything to disk) will reduce your compile-time, yes. –  Shinrai Feb 17 '11 at 0:04
1  
Can you provide more information on how you are invoking it? What options? –  Keith Feb 17 '11 at 0:06
    
Currently I am working on a plugin for the "R" language which makes calls to C. The C code is compiled when inside the "R" interpreter I type 'install.packages("package.tar.gz", repos=NULL)' –  Nick Feb 17 '11 at 0:28
add comment

1 Answer 1

up vote 2 down vote accepted

The best way to speed up recompiles of a developing code is to cache the compiler outputs with ccache. It will work best if only small parts of the code get modified.

Additionally, if you have access to a lot of machines distcc allows you to distribute your compile jobs over a network (that way I can say without fear "Do me a make -j100!). Depending on how many machines you have available this might give a sizeable speed boost.

share|improve this answer
    
Any idea how to use ccache for installing an R p –  Nick Feb 17 '11 at 0:29
    
install.packages just calls the compiler, and ccache mimics the compiler for all practical purposes, so you shouldn't need to do anything special for your R use case. –  Benjamin Bannier Feb 17 '11 at 0:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.