Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .