Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 3,607
    • Issues 3,607
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 199
    • Merge Requests 199
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #16233

Closed
Open
Opened Jan 25, 2019 by Alec Theriault@harpocrates
  • Report abuse
  • New issue
Report abuse New issue

HIE file generation is inefficient

Generating HIE files eats up a lot of memory and takes a long time. There are at least two big parts to this:

  • Every expression in the AST is desugared via deSugarExpr for the purpose of extracting a type. GHC ends up doing the same work multiple times for the same nodes. Ex: in order to desugar HsApp _ fun arg, GHC desugars both fun and arg, yet the HIE code doesn't cache that (so it ends up desugaring fun and arg at least once more).
  • There is a lot of stuff being written into these HIE files, making them quite big (even after compressing/deduplicating type information). One data point: the largest HIE file at time of writing is Parser.hie, which is 7.2MB, compared to just 58K for Parser.hiQ Writing large files is naturally going to take up memory and be slow.
Trac metadata
Trac field Value
Version 8.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture

Related issues

  • Discussion
  • Designs
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
4
Labels
bug hie files P::normal Trac import
Assign labels
  • View project labels
Reference: ghc/ghc#16233