Commit 64462544 authored by rwbarton's avatar rwbarton Committed by Ben Gamari
Browse files

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:
parent 10d28d0a
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment