是否值得缓存Delphi内存管理器创建的对象? [英] Is it worth caching objects created by Delphi's Memory Manager?
问题描述
从最近的测试 - 如果对象创建不昂贵(即不依赖于外部资源)访问文件,注册表,数据库...),那么你将很难打Delphi的内存管理器。这很快。
当然,如果您使用的是最近的Delphi,如果没有,则从 SourceForge ,并使用它而不是Delphi的内部MM。
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.
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.
这篇关于是否值得缓存Delphi内存管理器创建的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!