Skip to content
Snippets Groups Projects
Commit 6a78a40b authored by Andreas Klebinger's avatar Andreas Klebinger Committed by Ben Gamari
Browse files

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
parent 7613a812
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Hoopl.Collections
( IsSet(..)
, setInsertList, setDeleteList, setUnions
......
......@@ -2,6 +2,8 @@
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Hoopl.Label
( Label
, LabelMap
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment