haskell-language-server
haskell-language-server copied to clipboard
Implement sharing for hls-graph Keys
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.