(super!) linear slowdown of parallel builds on 40 core machine
|Reported by:||carter||Owned by:|
|Keywords:||Cc:||slyfox, tibbe, gidyn, nh2, kolmodin, erikd, kazu-yamamoto, scpmw, mboes, hjarvi, sjakobi, michalt, mnislaih|
|Type of failure:||Compile-time performance bug||Test Case:|
|Related Tickets:||#910, #8224||Differential Rev(s):|
Description (last modified by )
I'm seeing slowdowns in parallel builds of a (simple!!) 6 module project when I
build it on a 40 core server that I'm using for work. For any given ghc invocation
-jn, once n>10, I start to see a super-linear slow down as a function of n,
here are some basic numbers,
These timings are another 2-4x worse if ghc is invoked indirectly via cabal-install /
According to the linux utility latencytop, 100% of ghc's cpu time was spent on user-space lock contention when I did the
The timing in the
-j40 case stayed the same even when ghc was also passed
-fforce-recomp to ensure it did the same )
A bit of experimentation makes me believe that *any* cabalized project on a 40 core machine will exhibit this performance issue.
cabal clean cabal configure --ghc-options="-j" cabal build -j1
should be enough to trigger the lock contention.
That said, I'll try to cook up a minimal repro that i can share the source for post haste.