-
Notifications
You must be signed in to change notification settings - Fork 571
dont force state results #4545 #4546
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
dont force state results #4545 #4546
Conversation
| & resolveReexports reexportRefs | ||
| setVolatileStateSTM ref (IdeVolatileState (AstData asts) (map reResolved results) rebuildCache) | ||
| pure (force results) | ||
| pure results |
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.
I have limited haskell XP so may be misunderstanding but I suspect that by allowing results to be lazy, the IDE doesn't have to calculate all of the results as the state may be recomputed before much or any of an old result is used.
Whereas, when it is forced, it is possible for many computations to be queued up on a large project and the results value can use up so much memory that the IDE starts to grind to a halt.
|
I think the PR is sound, CI currently fails presumably because of the Azure debacle |
|
We'll need #4548 merged before this can pass |
…o lazy-state-result-purescript#4545
|
As #4548 is merged, is this ok to merge now? |
f-f
left a comment
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.
This looks good to me - could someone else take a look as well?
|
This patch appears to be reverting 2606727 from #3006, which means at least three things:
|
|
@kritzcreek I know that commit was 7y ago, but do you have any recollection about this? |
|
Oh my, I had to think for a bit...
Actually meant I'm not sure if making things lazy here is going to help with peak memory usage, it might just delay it until you start sending some requests against the updated IdeState. Sorry, it's been a long time so I'm very fuzzy on the details... |
|
fwiw, this change brings down what normally is 30 GBs of peak memory usage down to 10 GBs alongside bringing down memory pressure/time-to-diagnostics quite a bit on our codebase. We also use this with a custom IDE command that filters which externs files get loaded. One side effect is that diagnostics are not immediately available until the first edit, but I'm not entirely sure if that's coming from this PR or the custom IDE command. This LGTM aside from removing the redundant |
|
Please don't take my comment as a blocker to merging. I haven't written Haskell in over 5(?) years, so I'm hardly an authority on the matter :D Just wanted to dump what context I could remember in case it was helpful. |
I assume by diagnostics you mean type info etc. It would certainly seem worth checking this with a clean build because that sounds like a blocker to me (and presumably not at all necessary or deep) |
|
This looks very easy to revert. If it was merged, it'd get released as a beta, right? |
Good point. I've removed them.
Also removed. I guess it would also be possible to only call |
|
This looks ready to merge to me; any final objections? |
Description of the change
To address #4545.
This change fixes the memory issues in our project and makes the IDE reasonable performant but I don't know if there are other ramifications.
Checklist: