Fix performance regression: re-instate -funbox-strict-fields
authorSimon Marlow <simonmar@microsoft.com>
Mon, 29 Oct 2007 15:07:30 +0000 (15:07 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Mon, 29 Oct 2007 15:07:30 +0000 (15:07 +0000)
Yikes!  While investigating the increase in code size with GHC 6.8
relative to 6.6, I noticed that in the transition to Cabal for the
libraries we lost -funbox-strict-fields, which is more or less
depended on by the IO library for performance.  I'm astonished that we
didn't notice this earlier!

To reduce the chances of this happening again, I put
-funbox-strict-fields in the OPTIONS_GHC pragma of the modules that
need it.  {-# UNPACK #-} pragmas would be better, though.

Data/HashTable.hs
Data/Typeable.hs
GHC/Arr.lhs
GHC/IOBase.lhs

index cb11e15..3db6cc9 100644 (file)
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -fno-implicit-prelude -funbox-strict-fields #-}
 
 -----------------------------------------------------------------------------
 -- |
 
 -----------------------------------------------------------------------------
 -- |
index f548dc9..b61960f 100644 (file)
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -fno-implicit-prelude -fallow-overlapping-instances #-}
+{-# OPTIONS_GHC -fno-implicit-prelude -fallow-overlapping-instances -funbox-strict-fields #-}
 
 -- The -fallow-overlapping-instances flag allows the user to over-ride
 -- the instances for Typeable given here.  In particular, we provide an instance
 
 -- The -fallow-overlapping-instances flag allows the user to over-ride
 -- the instances for Typeable given here.  In particular, we provide an instance
index 25505fc..2c23faa 100644 (file)
@@ -1,5 +1,5 @@
 \begin{code}
 \begin{code}
-{-# OPTIONS_GHC -fno-implicit-prelude -fno-bang-patterns #-}
+{-# OPTIONS_GHC -fno-implicit-prelude -fno-bang-patterns -funbox-strict-fields #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.Arr
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.Arr
index 3f93ef9..3b82a52 100644 (file)
@@ -1,5 +1,5 @@
 \begin{code}
 \begin{code}
-{-# OPTIONS_GHC -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -fno-implicit-prelude -funbox-strict-fields #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.IOBase
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.IOBase