是否值得缓存Delphi内存管理器创建的对象? [英] Is it worth caching objects created by Delphi's Memory Manager?

查看:183
本文介绍了是否值得缓存Delphi内存管理器创建的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个创建和销毁成千上万个对象的应用程序。是否值得缓存和重用对象,或者Delphi的内存管理器足够快,多次创建和销毁对象并不是一件很大的开销(而不是跟踪缓存)当我说值得的时候,当然我正在寻找

解决方案

从最近的测试 - 如果对象创建不昂贵(即不依赖于外部资源)访问文件,注册表,数据库...),那么你将很难打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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆