-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various strictness improvements #3413
Conversation
3e20fc3
to
cb99e7d
Compare
@@ -1455,18 +1455,6 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do | |||
|
|||
case (mb_checked_iface, recomp_iface_reqd) of | |||
(Just iface, UpToDate) -> do | |||
-- If we have an old value, just return it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that reusing the same ModDetails
as we had last time can keep the previous HscEnv
and corresponding HomePackageTable
data structures alive. Solution is to delete this code and always regenerate the ModDetails
from the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!! Very important to do this (and cheap)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a cautionary note? should we somehow get rid of old_value
entirely? or is it okay to use it so long as we don't retain anything from it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need it for the old ModIface
(which is safe to use).
@@ -45,7 +46,7 @@ data GetInstanceBindTypeSigs = GetInstanceBindTypeSigs | |||
|
|||
data InstanceBindTypeSig = InstanceBindTypeSig | |||
{ bindName :: Name | |||
, bindRendered :: T.Text | |||
, bindRendered :: !T.Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this needs to be strict while the other values arent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It showed up in a profile, the others are likely to already be evaluated I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then a comment would be nice.
Also, would a guideline be wise that generally says everything in records needs a bang, and only in certain exceptional cases you don't need them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it seems clearer to bang everything in situations like this? Unsure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Various strictness annotations that marginally improve heap usage.