diff options
author | U-Maokai\andi <C:\Users\andi\AppData\Roaming\The Bat!> | 2018-04-13 11:34:03 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-04-13 11:34:08 -0400 |
commit | 6a78a40b616369b280630fe6259be35be9806caa (patch) | |
tree | 92e5bc7dc6d28a6e4c4617ba3a3244bfe4399f01 /compiler/cmm | |
parent | 7613a812888424b49cb334a4e63bd7280adf2774 (diff) | |
download | haskell-6a78a40b616369b280630fe6259be35be9806caa.tar.gz |
Use newtype deriving for Hoopl code
Hoopl.Collections/.Label has newtype containers which derive
Functor/Traversable.
Enabling GeneralizedNewtypeDeriving improves allocation count and
compile time when building these files for GHC.
```
Vanilla, O1
<<ghc: 378555664 bytes, 76 GCs, 8663140/18535016 avg/max bytes
residency (5 samples), 63M in use, 0.000 INIT (0.000 elapsed), 0.219
MUT (0.354 elapsed), 0.141 GC (0.138 elapsed) :ghc>>
GeneralizedNewtypeDeriving , O1
<<ghc: 301026536 bytes, 78 GCs, 8392886/17181088 avg/max bytes
residency (5 samples), 63M in use, 0.000 INIT (0.000 elapsed), 0.156
MUT (0.230 elapsed), 0.094 GC (0.106 elapsed) :ghc>>
```
Test Plan: ci
Reviewers: bgamari, simonmar, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: mpickering, RyanGlScott, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4583
Diffstat (limited to 'compiler/cmm')
-rw-r--r-- | compiler/cmm/Hoopl/Collections.hs | 2 | ||||
-rw-r--r-- | compiler/cmm/Hoopl/Label.hs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/cmm/Hoopl/Collections.hs b/compiler/cmm/Hoopl/Collections.hs index ef7de4a078..f8bdfda3d1 100644 --- a/compiler/cmm/Hoopl/Collections.hs +++ b/compiler/cmm/Hoopl/Collections.hs @@ -2,6 +2,8 @@ {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} + module Hoopl.Collections ( IsSet(..) , setInsertList, setDeleteList, setUnions diff --git a/compiler/cmm/Hoopl/Label.hs b/compiler/cmm/Hoopl/Label.hs index 6eae115779..caed683151 100644 --- a/compiler/cmm/Hoopl/Label.hs +++ b/compiler/cmm/Hoopl/Label.hs @@ -2,6 +2,8 @@ {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} + module Hoopl.Label ( Label , LabelMap |