Plan of Attack for Parallel Builds

Johan Tibell johan.tibell at gmail.com
Wed Mar 30 10:15:51 CEST 2011


On Wed, Mar 30, 2011 at 10:06 AM, Johan Tibell <johan.tibell at gmail.com> wrote:
> I think the most important setting is the number of worker threads
> (e.g. -jX). Load average sounds like a cool idea but I don't know how
> well it'll work in practice. Gentoo's Portage uses it so you might
> snoop around there for more info.

I should have mentioned that there is a good reason to support a load
average *and* a job count flag:

- Some jobs might be I/O bound for longer periods of time, making it
worthwhile to spawn new ones. This is a dynamic property of the
process which might be hard for the user to predict before running
cabal install. The user does know how many cores he/she has and should
be able to give a good load average.

- The build system (e.g. make) might itself spawn several jobs,
resulting in too many jobs given the number of available cores. Using
load average Cabal could scale down the number of jobs it uses in that
case.

Johan



More information about the cabal-devel mailing list