[commit: ghc] ghc-8.0: Fix a performance issue with -fprint-expanded-synonyms (5c6e25f)

git at git.haskell.org git at git.haskell.org
Fri Aug 26 14:38:38 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/5c6e25f4cee5f53d4a6f4f20e6da63a65b4a1c17/ghc

>---------------------------------------------------------------

commit 5c6e25f4cee5f53d4a6f4f20e6da63a65b4a1c17
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
    
    (cherry picked from commit e4834edf4418ace657361649365979e29ebd9daa)


>---------------------------------------------------------------

5c6e25f4cee5f53d4a6f4f20e6da63a65b4a1c17
 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         |   9 ++
 4 files changed, 227 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 5c6e25f4cee5f53d4a6f4f20e6da63a65b4a1c17


More information about the ghc-commits mailing list