<div dir="ltr"><div>Perhaps I am confused as well. I would have to investigate to see what the precise situation was.<br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Jan 23, 2025 at 12:40 PM ÉRDI Gergő <<a href="mailto:gergo@erdi.hu">gergo@erdi.hu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'll get back to you with details as I can.<br>
<br>
But one thing I noticed is that contrary to my expectations, when <br>
replacing the ModDetails with fresh ones, the real cost comes not from the <br>
fact that we have to re-evaluate the various parts of the ModDetails, but <br>
rather the call to `fillModDetails` itself!<br>
<br>
In other words, I can replicate most of the slowdown by calling <br>
`fillModDetails` on the interfaces in the HPT but throwing its result away <br>
and keeping the HPT as is. This sounds like bad news to me.<br>
<br>
Your remark that there are HomeModInfos referenced outside the HPT <br>
confuses me. I thought the whole reason this could work, and the whole <br>
reason I can see memory usage improvement, is because the HomeModInfos are <br>
not stored outside the HPT? If they are, home come my replacing them in <br>
the HPT with fresh ModDetails helps with memory usage instead of making it <br>
worse?<br>
<br>
On Thu, 23 Jan 2025, Matthew Pickering wrote:<br>
<br>
> That's good news.<br>
> <br>
> I don't think the first idea will do very much as there are other references to the<br>
> final "HomeModInfo" not stored in the HPT.<br>
> <br>
> Have you constructed a time profile to determine why the runtime is higher? With the<br>
> second approach you are certainly trading space usage for repeating work.<br>
> <br>
> If you actually do have a forest, then ideally you would replace the ModDetails after<br>
> it will never be used again.<br>
> <br>
> You are likely also missing other patches important for memory usage.<br>
> <br>
> * <a href="https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12582" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12582</a><br>
> * <a href="https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12347" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12347</a><br>
> <br>
> I can't comment about the 17 HPT, what do the retainer stacks look like in ghc-debug?<br>
> <br>
> PS.  Please use eventlog2html so the profiles are readable! You can use it on .hp<br>
> profiles.<br>
> <br>
> Cheers,<br>
> <br>
> Matt</blockquote></div>