Excessive system time during execution of GHC-built executables on macOS
It seems that the executables built by GHC on my configuration of macOS are slow, clocking in 80% of my machine's cycles in system time.
Here is what I know.
Everything tested bootstrapping with both GHC 8.6.1 and GHC 8.6.2. There is no observable difference between these bootstrapping compilers. The detailed data reported is all from GHC 8.6.1.
When I try to build GHC, stage 1 builds snappily. But once stage-1 gets used, it slows to a crawl.
Activity Monitor reports that my computer is spending roughly 80% of its time in the System space, not the User space. (While building ghc-stage1 itself, there is barely any system activity.)
I have sampled ghc-stage1 during a rts_dist_HC call. Samples are at https://gist.github.com/goldfirere/7316920ad37d776c25c15dbb0ed5996f
dtrussd the same, with output at https://gist.github.com/goldfirere/621ce9072e1204d30e96e7daecc80d02
macOS High Sierra, 10.13.6
Processor: 3.5 GHz Intel Core i5
Memory: 16 GB 2400 MHz DDR4
SSD main storage, formatted with APFS
gcc is clang-1000.11.45.5, Apple LLVM version 10.0.0, thread model: posix
Others (see thread) have not been able to repro, but this is very reliable for me.