Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19190

Closed
Open
Opened Jan 08, 2021 by Matthew Pickering@mpickeringDeveloper

Lack of sharing in `GHC.Types.Demand`

Similarly to #17292 (closed) there is quite a lot of redundant allocation in GHC.Types.Demand of identical demands.

Two which I immediately saw in the profile:

-- 320 000 allocations of this demand which is equal to `nopDmdType`
ghc:GHC.Types.Demand:DmdType[containers-0.6.4.1:Data.IntMap.Internal:Nil,ghc-prim:GHC.Types:[],ghc:GHC.Types.Demand:Dunno]
-- 150 000 allocations of this demand which is equal to `poly0N`
ghc:GHC.Types.Demand:Poly[ghc:GHC.Types.Demand:C_0N]

We should try and make sure we reuse the CAF as much as possible to save allocations and GC pressure.

In general, perhaps we should think of doing some limited hash consing in the RTS, there are probably a lot of applications which end up with a similar problem.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#19190