Avoid linear lookup in unload_wkr in the Linker
authorBartosz Nitka <bnitka@fb.com>
Fri, 21 Jul 2017 18:41:41 +0000 (11:41 -0700)
committerBartosz Nitka <niteria@gmail.com>
Sat, 22 Jul 2017 14:19:21 +0000 (07:19 -0700)
commitc1d9690619ea38bad3b9aa529d72d10c6206f2e9
treec81433c181ea339e5416289c5ab9ebf9ff8a2433
parentcbbf0837d47622f1a3e889a59690d96e7947c6cd
Avoid linear lookup in unload_wkr in the Linker

I've encountered an issue with following
reproduction steps:
* `:load` a large number of modules (~2000)
* compile a BCO that depends on many other BCOs from many other modules
* `:reload`
* try to compile anything, even `1` works

Before this patch the last step takes ~5s.
It takes 80ms after.

Test Plan: harbormaster

Reviewers: simonmar, austin, hvr, bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3770
compiler/ghci/Linker.hs