Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Hover causes far too much memory #1156

Closed
mpickering opened this issue Apr 4, 2019 · 3 comments · Fixed by #1186
Closed

Hover causes far too much memory #1156

mpickering opened this issue Apr 4, 2019 · 3 comments · Fixed by #1186
Assignees
Milestone

Comments

@mpickering
Copy link
Collaborator

The way that the types are collected from the AST by using syb uses a lot of memory. This was already identified when haddock started using HIE files for its hyperlinker. The solution is to
make the traversal smarter to only recover types at the leaves rather than for all subexpressions.

This issues makes HIE unusable with GHC (or any big project) as the process of traversing a single module is too expensive.

cc @wz1000

@mpickering
Copy link
Collaborator Author

This change makes a big difference. mpickering/ghc-mod@1544779

If someone wants to finish this off then they need to reimplement collectSpanTypes in Haskell.Ide.Engine.ArtifactMap in order to build the type map directly whilst performing the query rather than building an intermediate list and copy these changes into ArtifactMap so the type map generation doesn't depend on ghc-mod at all.

Another reference is - https://gitlab.haskell.org/ghc/ghc/blob/fef4a8dd65428cbcdc4aa58f0444eae9f5cc63ed/compiler/hieFile/HieAst.hs

@fendor
Copy link
Collaborator

fendor commented Apr 15, 2019

I can take a look at it, this week!

@fendor fendor self-assigned this Apr 17, 2019
@fendor
Copy link
Collaborator

fendor commented Apr 17, 2019

Problem has been adressed and merged into #1126.

@fendor fendor mentioned this issue Apr 21, 2019
2 tasks
@alanz alanz added this to the prehistory milestone Jul 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants