Remove read instances from our Haskell code
It turns out that optimising 'read' derived instances (via -O) for complex data types (like OpCode, or the various objects) can be slow to very slow. Disabling such instances results in (time make $all_our_haskell_binaries) large compile-time savings and also smaller (unstripped) binaries (by a significant amount): ghc 6.12: time htools sz hconfd sz with read: 4m50s 12,244,694 14,927,928 no read: 3m30s 10,234,305 12,536,745 ghc 7.6: with read: 14m45s 13,694,761 15,741,755 no read: 3m40s 11,631,373 13,245,134 So let's remove these instances, since we never use read in production for our custom types, and even when debugging in GHCI, we can simply use the 'show' representation to create the types, without needing to actually parse from strings. Note: for the very slow ghc 7.6 compilation time, I filled a ticket (ghc #7450), since it is surprising(ly slow). Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
Showing
- htest/Test/Ganeti/Query/Language.hs 1 addition, 2 deletionshtest/Test/Ganeti/Query/Language.hs
- htools/Ganeti/BasicTypes.hs 3 additions, 3 deletionshtools/Ganeti/BasicTypes.hs
- htools/Ganeti/Common.hs 2 additions, 2 deletionshtools/Ganeti/Common.hs
- htools/Ganeti/Confd/Types.hs 1 addition, 1 deletionhtools/Ganeti/Confd/Types.hs
- htools/Ganeti/HTools/Cluster.hs 2 additions, 2 deletionshtools/Ganeti/HTools/Cluster.hs
- htools/Ganeti/HTools/Group.hs 2 additions, 2 deletionshtools/Ganeti/HTools/Group.hs
- htools/Ganeti/HTools/Instance.hs 1 addition, 1 deletionhtools/Ganeti/HTools/Instance.hs
- htools/Ganeti/HTools/Loader.hs 3 additions, 3 deletionshtools/Ganeti/HTools/Loader.hs
- htools/Ganeti/HTools/Node.hs 1 addition, 1 deletionhtools/Ganeti/HTools/Node.hs
- htools/Ganeti/HTools/Types.hs 6 additions, 6 deletionshtools/Ganeti/HTools/Types.hs
- htools/Ganeti/JSON.hs 1 addition, 1 deletionhtools/Ganeti/JSON.hs
- htools/Ganeti/Luxi.hs 1 addition, 1 deletionhtools/Ganeti/Luxi.hs
- htools/Ganeti/Objects.hs 2 additions, 2 deletionshtools/Ganeti/Objects.hs
- htools/Ganeti/OpParams.hs 6 additions, 6 deletionshtools/Ganeti/OpParams.hs
- htools/Ganeti/Query/Language.hs 4 additions, 13 deletionshtools/Ganeti/Query/Language.hs
- htools/Ganeti/Rpc.hs 1 addition, 1 deletionhtools/Ganeti/Rpc.hs
- htools/Ganeti/THH.hs 7 additions, 7 deletionshtools/Ganeti/THH.hs
- htools/Ganeti/Types.hs 3 additions, 3 deletionshtools/Ganeti/Types.hs
Loading
Please register or sign in to comment