[darcs-devel] Re: Building darcs

Simon Marlow simonmarhaskell at gmail.com
Wed Feb 7 02:34:01 PST 2007


Zachary P. Landau wrote:

> When I'm working on the darcs code, I'm generally rebuilding the code
> fairly often.  Unfortunately this seems to take a long time.  Certain
> files, because of dependencies, have to build a lot of files again.  A
> clean build on my machine, a 3.4ghz machine with 1 gig of ram, takes
> somewhere around 15 minutes.  Each individual file takes a certain
> amount of time, and then the final link at the end takes quite a bit by
> itself.

When GHC compiles files with optimisation on, the .hi files contain a lot of 
information required for cross-module optimisation (the definitions of small 
functions, strictness properties, etc.).  This has the effect that more 
recompilation will be required when something changes: it's very likely that 
small changes to a module will cause the optimisation annotations in the .hi 
file to change, forcing more recompilation.  However when you compile without 
optimisation, the .hi file only contains the types of exported functions and 
datatypes, which is much less likely to change when you modify the file.  So for 
fast edit/compile cycles, you really want to compile with optimisation off.

> The tips under 'Faster edit-compile cycle' on
> http://darcs.net/DarcsWiki/DeveloperTips don't seem to be valid anymore.
> I don't see O2 under GHCFLAGS.  I did try the ghci line but it fails
> with an error when trying to link in curl.  I may try to fight with this
> later, as it seems like a good option.  I'll update that page once I'm
> sure I'm not just doing something stupid.
> 
> I also tried playing with the -j option with make, but that did a fairly
> good job of bringing my system to its knees.

I would try -j2, or more depending on how many cores in your machine.  Reduce 
the number if you're running out of memory.

Cheers,
	Simon


More information about the darcs-devel mailing list