optimisation
authorJoey Hess <joeyh@joeyh.name>
Wed, 4 Dec 2019 18:14:35 +0000 (14:14 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 4 Dec 2019 18:30:22 +0000 (14:30 -0400)
commitf08cc8218b68812c44362402960d4608d1447ebd
treef36cc1fd7464b759d43a13d3fa8e2bcd310cea14
parentb69c5be9ed25ac2abe4533f4852acfdf90d4dcba
optimisation

This was already optimised before, but profiling found that delEntry was
around 1.5% of the total runtime of git-annex whereis. It was being
called once per environment variable per file processed.

Fixed by better caching. Since withIndexFile is almost always run with
the same .git/annex/index file, it can cache the modified environment,
rather than re-modifying it each time called.

(cherry picked from commit 6535aea49a402b9ca08fc1070358374e5e0eb618)
Annex.hs
Annex/GitOverlay.hs