haskell-cabal.eclass: unleash full parallelism of parallel ghc
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 2 Sep 2016 09:26:43 +0000 (10:26 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Fri, 2 Sep 2016 09:29:51 +0000 (10:29 +0100)
commitb3b64a95b9653963a2868278fd0130858a9eb9f0
tree7228fae8f1f598deff28975b5f5a041ef879bc13
parent1e7e5cf5b4395cb2ff0207ca4749d11b95a6d4d5
haskell-cabal.eclass: unleash full parallelism of parallel ghc

I've explored scalability of 'ghc --make -j' a bit in
    https://ghc.haskell.org/trac/ghc/ticket/9221

Some takeaways:
- never specify -j<N> with N > CPU. garbage collector threads
  waste kernel time running sched_yield()
- GHC allocates A Lot: large nursery decreases GC interruptions.
  We fix it with '-A256M'
- for large nursery enabling work-stealing makes GC finish faster
  on each collection cycle.
  We fix it with -qb0

While at it move HCFLAGS setup after parallel defaults.
That allows user to override defaults with own HCFLAGS.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/haskell-cabal.eclass