Fix a performance bug in GhcMake.downsweep
authorSimon Marlow <marlowsd@gmail.com>
Wed, 10 May 2017 12:05:38 +0000 (05:05 -0700)
committerBartosz Nitka <niteria@gmail.com>
Wed, 10 May 2017 12:06:03 +0000 (05:06 -0700)
commit1893ba12fe1fa2ade35a62c336594afcd569736e
tree3c1894b71ea8c3dae88380760d1af3ec7c6c080a
parent26f509a992ebc6910ed2309b46f3f1d44efba7c9
Fix a performance bug in GhcMake.downsweep

Every time we encountered a non-home module during the downsweep, we
were removing it from the finder cache.  That meant we were searching
the filesystem for every import, rather than once per downsweep.  The
fix is just to flush the finder cache before the downsweep, and
repopulate it for home modules that haven't changed.

Speeds up downsweep by about 25% on a large example I have.

Test Plan: Harbourmaster

Reviewers: bgamari, niteria, austin, erikd

Reviewed By: bgamari, niteria

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3554
compiler/main/GhcMake.hs