[commit: ghc] master: TcTypeable: Try to reuse KindReps (a694cee)

git at git.haskell.org git at git.haskell.org
Fri Mar 3 21:36:00 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a694cee77b64235b42029fea248453ddf6b17d17/ghc

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

commit a694cee77b64235b42029fea248453ddf6b17d17
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Fri Mar 3 14:39:00 2017 -0500

    TcTypeable: Try to reuse KindReps
    
    Here we rework the TcTypeable implementation to reuse KindRep bindings
    when possible. This is an attempt at minimizing the impact of Typeable
    binding generation by reducing the number of bindings that we produce.
    
    It turns out that this produces some pretty reasonable compiler
    allocations improvements. It seems to erase most of the increases
    initially introduced by TTypeable in the testsuite. Moreover, nofib
    shows,
    ```
            -1 s.d.                -----          -3.555%
            +1 s.d.                -----          +1.937%
            Average                -----          -0.847%
    ```
    
    Here are a few of the high-scorers (ignore last column, which is for
    D3219),
    ```
    veritas
              Types             88800920         -18.945%         -21.480%
    
    veritas
            Tactics            540766744         -27.256%         -27.338%
    
    sched
               Main            567013384          -4.947%          -5.358%
    
    listcompr
               Main            532300000          -4.273%          -4.572%
    
    listcopy
               Main            537785392          -4.382%          -4.635%
    
    anna
           BaseDefs           1984225032         -10.639%         -10.832%
    
    ```
    as expected, these tend to be modules with either very many or very
    large types.
    
    Test Plan: Validate
    
    Reviewers: austin, dfeuer
    
    Subscribers: simonmar, dfeuer, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3166


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

a694cee77b64235b42029fea248453ddf6b17d17
 compiler/coreSyn/TrieMap.hs                        |  28 ++-
 compiler/typecheck/TcTypeable.hs                   | 259 +++++++++++++--------
 .../tests/deSugar/should_compile/T2431.stderr      |  47 ++--
 .../should_compile/DumpTypecheckedAst.stderr       | 104 +++------
 testsuite/tests/perf/compiler/all.T                |   9 +-
 testsuite/tests/roles/should_compile/Roles1.stderr | 101 +++-----
 .../tests/roles/should_compile/Roles13.stderr      |  85 +++----
 .../tests/roles/should_compile/Roles14.stderr      |  15 +-
 testsuite/tests/roles/should_compile/Roles2.stderr |  31 +--
 testsuite/tests/roles/should_compile/Roles3.stderr |  56 ++---
 testsuite/tests/roles/should_compile/Roles4.stderr |  33 +--
 testsuite/tests/roles/should_compile/T8958.stderr  |  66 ++----
 .../tests/simplCore/should_compile/T7360.stderr    |  61 ++---
 .../tests/simplCore/should_compile/T8274.stdout    |  14 +-
 testsuite/tests/th/TH_Roles2.stderr                |  11 +-
 15 files changed, 414 insertions(+), 506 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 a694cee77b64235b42029fea248453ddf6b17d17


More information about the ghc-commits mailing list