Fix space leak on cradle reloads#1316
Conversation
|
Now that the |
But hiedb doesn't index build depends, does it? |
Ah, right. I misread the PR and thought it was for the project local exports map. However, we could still index and persist a export map for dependent packages, by indexing the exports directly from the ModIface instead of the |
This is necessary to prevent leaking the package exports
Expensive and already covered by 'code actions after cradle edit'
This was missing from the list
This fixes the th-linking-test because it restores the previous dynamic semantics in which the package exports are only evaluated when code actions are requested.
6c6b4f7 to
4176f9f
Compare
|
All the tests pass now, but the benchmark run on master (where the leak is still present) times out. I'll wait for the speed ups in #1315 to land |
That's how the exports map works now, except that it isn't persisted. Do you think that persisting would be worth the effort? I think that's a nice idea, please file an issue! |
We were leaking 'PackageExports' values for all past 'HscEnv's.
Fixed by moving the package exports inside the 'HscEnvEq'.
I have also added two experiments to characterise the leak, the main one is 'code actions after cradle edit'. On the Cabal 3 example, this is what the experiment looks like: