[commit: ghc] master: Fix a performance issue with -fprint-expanded-synonyms (e4834ed)
git at git.haskell.org
git at git.haskell.org
Sun May 15 11:02:34 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e4834edf4418ace657361649365979e29ebd9daa/ghc
>---------------------------------------------------------------
commit e4834edf4418ace657361649365979e29ebd9daa
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Sun May 15 07:04:39 2016 -0400
Fix a performance issue with -fprint-expanded-synonyms
The type synonym expander was doing redundant work by looking at same
types again and again. This patch fixes the loop code when both of the
types can be expanded, to do `O(min(n, m))` comparisons and `O(n + m)`
expansions, where `n` is expansions of the first type and `m` is
expansions of the second type.
Reported by sjcjoosten in T10547.
Test Plan:
Added a regression test that was taking several minutes to type check
before this patch.
Reviewers: bgamari, simonpj, austin, ezyang
Reviewed By: bgamari, simonpj, austin, ezyang
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2198
GHC Trac Issues: #10547
>---------------------------------------------------------------
e4834edf4418ace657361649365979e29ebd9daa
compiler/typecheck/TcErrors.hs | 196 +++++++++++++++++-----------
testsuite/tests/perf/compiler/T10547.hs | 90 +++++++++++++
testsuite/tests/perf/compiler/T10547.stderr | 11 ++
testsuite/tests/perf/compiler/all.T | 8 ++
4 files changed, 226 insertions(+), 79 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e4834edf4418ace657361649365979e29ebd9daa
More information about the ghc-commits
mailing list