ghc spends 80% of it's real time in neither user-space nor system-space
Summary
This is a sort-of weird and under-diagnosed issue; feel free to close it or tell me that I need to do more digging.
On GitHub Actions CI (see "standalone-haskell" in this log), I get runtimes for ghc such as (real: 1036.52, user: 195.46, sys: 36.56, mem: 3758368 ko), which has 77% of the real time unaccounted for. It seems to be moderately consistent (see, e.g., another log here). I'm running ghc 8.2.2 on the CI. Up-to-date runs should be able to be found here for the foreseeable future. Although the Haskell code is generated via extraction from Coq, the CI generates artifacts, which contain the extracted Haskell code, and thus reproducing this issue does not require having Coq installed.
Interestingly, when I compile the code locally with ghc 8.0.2, I get times like (real: 106.61, user: 105.55, sys: 1.48, mem: 2671760 ko), which obviously don't show this issue. I'm not sure if this is an regression of 8.2.2 over 8.0.2, or whether something strange is going on with the CI configuration. (I can try to build GHC from source or something, if need-be, but I'd prefer if someone else can confirm this behavior. If y'all want, I can set up a minimal repository that demonstrates this behavior with GitHub Actions.)
Steps to reproduce
- Make sure you have at least 95 MB of free space (the .hs file 21 MB, the executable is 27 MB, and the .o file is about 46 MB).
- Download unsaturated_solinas.tar.gz and unpack it into
unsaturated_solinas.hs
. - Run
command time -f "(real: %e, user: %U, sys: %S, mem: %M ko)" ghc -o unsaturated_solinas unsaturated_solinas.hs
.
Expected behavior
The real time should be roughly the same as the user time + the system time.
Environment
- GHC version used: 8.2.2
Optional:
- Operating System: Linux fv-az50 5.0.0-1035-azure #37 (closed)-Ubuntu SMP Wed Mar 18 11:21:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux (Ubuntu 18.04.4 LTS)
- System Architecture: x86_64