Skip to content

Builds are kind of not using Hyper Threading #4391

@varosi

Description

@varosi

General summary/comments

On Mac OS processor hyper threading is not well utilised.

Steps to reproduce

For example:

  1. stack install hoogle on a clean configuration
  2. Most of the time when all the cores are utilised it will be without any usage of Hyper Threading.

Expected

To use all available logical cores, not just physical ones.

Actual

Currently most build processes are fully utilising only single logical thread per core.
Tested on iMac and MacBook Pro with latest OSX Mojave.
See this video: https://drive.google.com/file/d/1YRPBURxrj6pr5AeTepUm3iCXwgvM4Hj7/view?usp=sharing
On the top you could see in green/red the logical cores of the system. Most of the time they are utilizing to only half of all (6 cores with HT = 12 logical cores). If more cores are used we would see that more than 6 are utilised. From time to time there are used all 12, but either they are less than 6, or they are 12. So I think that GHC build processes run on 6 cores and from time to time we could observe two GHC processes with 6 cores. It's strange.

Do someone else observe that on Mac? I'm even not sure it's from Stack. It could be Cabal or GHC build. But I'm trying to start from somewhere.

Stack version

$ stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0

Method of installation

  • Official binary

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions