diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-03-03 14:39:00 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-03 14:39:01 -0500 |
commit | a694cee77b64235b42029fea248453ddf6b17d17 (patch) | |
tree | 1177b386761a624a9db9f2e41753e8061381ff81 /testsuite/tests/deSugar/should_compile/T2431.stderr | |
parent | fa360eabe5a01815f27a09df4a245546ede9210a (diff) | |
download | haskell-a694cee77b64235b42029fea248453ddf6b17d17.tar.gz |
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
Diffstat (limited to 'testsuite/tests/deSugar/should_compile/T2431.stderr')
-rw-r--r-- | testsuite/tests/deSugar/should_compile/T2431.stderr | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index 2993e15d95..1fd5b44d86 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -1,7 +1,7 @@ ==================== Tidy Core ==================== Result size of Tidy Core - = {terms: 83, types: 49, coercions: 1, joins: 0/0} + = {terms: 74, types: 46, coercions: 1, joins: 0/0} -- RHS size: {terms: 2, types: 4, coercions: 1, joins: 0/0} T2431.$WRefl [InlPrag=INLINE[2]] :: forall a. a :~: a @@ -52,25 +52,20 @@ $krep :: GHC.Types.KindRep [GblId, Caf=NoCafRefs] $krep = GHC.Types.KindRepTYPE GHC.Types.LiftedRep --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} $krep1 :: GHC.Types.KindRep [GblId, Caf=NoCafRefs] -$krep1 = GHC.Types.KindRepTYPE GHC.Types.LiftedRep +$krep1 = GHC.Types.KindRepFun $krep $krep --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} $krep2 :: GHC.Types.KindRep [GblId, Caf=NoCafRefs] -$krep2 = GHC.Types.KindRepTYPE GHC.Types.LiftedRep +$krep2 = GHC.Types.KindRepFun $krep $krep1 --- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $krep3 :: GHC.Types.KindRep [GblId, Caf=NoCafRefs] -$krep3 = GHC.Types.KindRepFun $krep1 $krep2 - --- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} -$krep4 :: GHC.Types.KindRep -[GblId, Caf=NoCafRefs] -$krep4 = GHC.Types.KindRepFun $krep $krep3 +$krep3 = GHC.Types.KindRepVar 0# -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $tc:~:1 :: GHC.Prim.Addr# @@ -92,34 +87,24 @@ T2431.$tc:~: T2431.$trModule $tc:~:2 0# - $krep4 - --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} -$krep5 :: GHC.Types.KindRep -[GblId, Caf=NoCafRefs] -$krep5 = GHC.Types.KindRepVar 0# - --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} -$krep6 :: GHC.Types.KindRep -[GblId, Caf=NoCafRefs] -$krep6 = GHC.Types.KindRepVar 0# + $krep2 -- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} -$krep7 :: [GHC.Types.KindRep] +$krep4 :: [GHC.Types.KindRep] [GblId, Caf=NoCafRefs] -$krep7 +$krep4 = GHC.Types.: - @ GHC.Types.KindRep $krep6 (GHC.Types.[] @ GHC.Types.KindRep) + @ GHC.Types.KindRep $krep3 (GHC.Types.[] @ GHC.Types.KindRep) -- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} -$krep8 :: [GHC.Types.KindRep] +$krep5 :: [GHC.Types.KindRep] [GblId, Caf=NoCafRefs] -$krep8 = GHC.Types.: @ GHC.Types.KindRep $krep5 $krep7 +$krep5 = GHC.Types.: @ GHC.Types.KindRep $krep3 $krep4 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} -$krep9 :: GHC.Types.KindRep +$krep6 :: GHC.Types.KindRep [GblId, Caf=NoCafRefs] -$krep9 = GHC.Types.KindRepTyConApp T2431.$tc:~: $krep8 +$krep6 = GHC.Types.KindRepTyConApp T2431.$tc:~: $krep5 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $tc'Refl1 :: GHC.Prim.Addr# @@ -141,7 +126,7 @@ T2431.$tc'Refl T2431.$trModule $tc'Refl2 1# - $krep9 + $krep6 |