Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance of weeder when type-class-roots = false is set. (#…
…172) For analysing evidence uses we collect evidence uses in, ```haskell requestedEvidence :: Map Declaration (Set Name) ``` In analyseEvidenceUses, we loop over all the names in all the sets of the map, to construct dependency graph after calling `getEvidenceTree` on the name. However, these names in sets across different declarations are duplicated a lot. In one example in a repo at work, we have 16961625 names in which only 200330 are unique. So now, we instead pre-construct an evidence trees map `Map Name [Declaration]` for all the unique name and perform a lookup in this map to construct the graph. In a private repo, the times before this change and after ``` ❯ find . -name '*.hie' | wc -l 1097 ❯ time result/bin/weeder # weeder from master real 5m53.707s user 5m50.350s sys 0m2.206s ❯ time result/bin/weeder # weeder from this branch real 0m34.008s user 0m31.716s sys 0m2.196s ```
- Loading branch information