haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Implement sharing for hls-graph Keys

Open wz1000 opened this issue 3 years ago • 0 comments

On large projects, duplicate Keys start to comprise a significant (~5-10%) fraction of the heap. This becomes better if we use Ints as keys and de-duplicate the actual values by storing them in maps. Keys are mostly just compared and hash during usual operation, printing them out is rare so a lookup shouldn't pessimize it much.

Also use HashSets to keep track of dependencies. However, this means that the underlying value for Keys will never be garbage collected once allocated.

wz1000 avatar Sep 21 '22 05:09 wz1000