<HTML>
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>Ah right, so things like "TmpUsedRegs" (an array of TUsedRegs) constantly being created and destroyed in the peephole optimizer is actually not that much of a penalty hit, and creating a pooled object for continuous use doesn't give that much of a performance gain?<br>
<div><br>
</div><div>Gareth<br>
</div> <br>
<br>
<span style="font-weight: bold;">On Sat 15/12/18 16:12 , Florian Klämpfl florian@freepascal.org sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">Am 12.12.2018 um 13:49 schrieb Ryan Joseph:
<br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">>> On Dec 12, 2018, at 7:20 PM, Martok <<a href="mailto:listbox@martoks-place.de">listbox@martoks-place.de</a>> wrote:
</span><br>
<span style="color: rgb(102, 102, 102);">>>
</span><br>
<span style="color: rgb(102, 102, 102);">>> Checking out the memory manager(s) could be useful as well - there are a lot of
</span><br>
<span style="color: rgb(102, 102, 102);">>> small allocations, that generally tends to put much stress on it.
</span><br>
<span style="color: rgb(102, 102, 102);">>> And any improvement there would also directly benefit user applications.
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> I was going to say the same thing myself and even planned to do a test. My profiles show the top hits being getmem/freemem which really don’t need to be there.
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> There’s no reason to be allocating and freeing nodes (for example) over and over again when we could just allocate a large pool at startup and return to the pool instead of freeing. It would make the compiler utilize more memory but that’s a good trade off for me personally. This is especially a good idea because the compiler is a one pass program so leaks over the long term aren’t a problem.
</span><br>
<br>
The memory manager itself pools already, so no need for the compiler. If somebody wants to improve the heap manager:
<br>
implement OS supported re-allocations (OS can move memory by just shuffling pages).
<br>
_______________________________________________
<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<br>
<a target="_blank" href="<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>"><span style="color: red;">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</span></a>
<br>
<br>
<br>
</blockquote></HTML>