Skip to content
  • Edward Z. Yang's avatar
    Split GBinary into GBinaryGet and GBinaryPut, speeds up compilation. · c641061f
    Edward Z. Yang authored
    
    
    Consider:
    
        {-# LANGUAGE DeriveGeneric #-}
        module A where
        import Data.Binary
        import GHC.Generics
        data T = T
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         () () () () () () () () () ()
         deriving Generic
        instance Binary T
    
    Without this patch, on GHC 7.10.2, building this -O2 takes 6.7s.  With
    this patch, it takes 1.7s.  Amazing.  (There are modest improvements
    with other versions of GHC too.)
    
    Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
    c641061f