[commit: ghc] master: Use newtype deriving for Hoopl code (6a78a40)
git at git.haskell.org
git at git.haskell.org
Fri Apr 13 16:08:27 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6a78a40b616369b280630fe6259be35be9806caa/ghc
>---------------------------------------------------------------
commit 6a78a40b616369b280630fe6259be35be9806caa
Author: U-Maokai\andi <C:\Users\andi\AppData\Roaming\The Bat!>
Date: Fri Apr 13 11:34:03 2018 -0400
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
>---------------------------------------------------------------
6a78a40b616369b280630fe6259be35be9806caa
compiler/cmm/Hoopl/Collections.hs | 2 ++
compiler/cmm/Hoopl/Label.hs | 2 ++
2 files changed, 4 insertions(+)
diff --git a/compiler/cmm/Hoopl/Collections.hs b/compiler/cmm/Hoopl/Collections.hs
index ef7de4a..f8bdfda 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 6eae115..caed683 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
More information about the ghc-commits
mailing list