I have an application that creates, and destroys thousands of objects. Is it worth caching and reusing objects, or is Delphi’s memory manager fast enough that creating and destroying objects multiple times is not that great an overhead (as opposed to keeping track of a cache) When I say worth it, of course I’m looking for a performance boost.
I have an application that creates, and destroys thousands of objects. Is it worth
Share
From recent testing – if object creation is not expensive (i.e. doesn’t depend on external resources – accessing files, registry, database …) then you’ll have a hard time beating Delphi’s memory manager. It is that fast.
That of course holds if you’re using a recent Delphi – if not, get FastMM4 from SourceForge and use it instead of Delphi’s internal MM.