[commit: ghc] master: Deserialize IfaceId more lazily (6446254)

Reid Barton rwbarton at gmail.com
Wed Mar 8 20:46:18 UTC 2017


Done in commit fdb594ed3286088c1a46c95f29e277fcc60c0a01.

Regards,
Reid

On Wed, Mar 8, 2017 at 7:18 AM, Simon Peyton Jones
<simonpj at microsoft.com> wrote:
> Reid
>
> I beg you to add a comment to these carefully-placed used of laziness!
> The informative commit message does not appear in the code :-).
>
> Simon
>
> |  -----Original Message-----
> |  From: ghc-commits [mailto:ghc-commits-bounces at haskell.org] On Behalf
> |  Of git at git.haskell.org
> |  Sent: 03 March 2017 21:36
> |  To: ghc-commits at haskell.org
> |  Subject: [commit: ghc] master: Deserialize IfaceId more lazily
> |  (6446254)
> |
> |  Repository : ssh://git@git.haskell.org/ghc
> |
> |  On branch  : master
> |  Link       :
> |  https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fghc.ha
> |  skell.org%2Ftrac%2Fghc%2Fchangeset%2F644625449a9b6fbeb9a81f1a7d0e7d184
> |  24fb707%2Fghc&data=02%7C01%7Csimonpj%40microsoft.com%7C9b1a8ffea4684b8
> |  f5e7608d4627d690f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6362417
> |  38152433434&sdata=H81TTDPPgdp%2BYQzqRFUtiyyfm%2Fn6YRQT%2BoOpJuehsOU%3D
> |  &reserved=0
> |
> |  >---------------------------------------------------------------
> |
> |  commit 644625449a9b6fbeb9a81f1a7d0e7d18424fb707
> |  Author: Reid Barton <rwbarton at gmail.com>
> |  Date:   Fri Mar 3 15:49:38 2017 -0500
> |
> |      Deserialize IfaceId more lazily
> |
> |      This change sped up the total validate --build-only time by 0.8%
> |      on my test system; hopefully a representative result.
> |
> |      I didn't bother making the other constructors lazy because for
> |      IfaceData and IfaceClass we need to pull on some of the fields
> |      in loadDecl, and all the others seem much more rare than IfaceId.
> |
> |      Test Plan: validate, perf
> |
> |      Reviewers: austin, bgamari
> |
> |      Reviewed By: bgamari
> |
> |      Subscribers: thomie
> |
> |      Differential Revision: https://phabricator.haskell.org/D3269
> |
> |
> |  >---------------------------------------------------------------
> |
> |  644625449a9b6fbeb9a81f1a7d0e7d18424fb707
> |   compiler/iface/IfaceSyn.hs | 8 ++------
> |   1 file changed, 2 insertions(+), 6 deletions(-)
> |
> |  diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs
> |  index d73a738..1c30476 100644
> |  --- a/compiler/iface/IfaceSyn.hs
> |  +++ b/compiler/iface/IfaceSyn.hs
> |  @@ -1565,9 +1565,7 @@ instance Binary IfaceDecl where
> |       put_ bh (IfaceId name ty details idinfo) = do
> |           putByte bh 0
> |           putIfaceTopBndr bh name
> |  -        put_ bh ty
> |  -        put_ bh details
> |  -        put_ bh idinfo
> |  +        lazyPut bh (ty, details, idinfo)
> |
> |       put_ bh (IfaceData a1 a2 a3 a4 a5 a6 a7 a8 a9) = do
> |           putByte bh 2
> |  @@ -1657,9 +1655,7 @@ instance Binary IfaceDecl where
> |           h <- getByte bh
> |           case h of
> |               0 -> do name    <- get bh
> |  -                    ty      <- get bh
> |  -                    details <- get bh
> |  -                    idinfo  <- get bh
> |  +                    ~(ty, details, idinfo) <- lazyGet bh
> |                       return (IfaceId name ty details idinfo)
> |               1 -> error "Binary.get(TyClDecl): ForeignType"
> |               2 -> do a1  <- getIfaceTopBndr bh
> |
> |  _______________________________________________
> |  ghc-commits mailing list
> |  ghc-commits at haskell.org
> |  https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h
> |  askell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-
> |  commits&data=02%7C01%7Csimonpj%40microsoft.com%7C9b1a8ffea4684b8f5e760
> |  8d4627d690f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6362417381524
> |  33434&sdata=L1dvXY%2BW%2Brv4gMqeWm8BGfIPifKK0DBndoJVF%2FCfu0c%3D&reser
> |  ved=0


More information about the ghc-devs mailing list