Quotation from Delphi's help for TObject.NewInstance:
One more way to get faster allocation is to use good-old free-lists. Example: let's say we have object for each dynamic effect. Instead of creating new effect each there happens, you just don't deallocate old one, but mark it as "free-for-use", put it in "list-of-free" objects, or whatever, and your allocation gets even faster!Override NewInstance only for special memory allocation requirements. For example, when allocating a large number of identical objects that all need to be in memory at the same time, you could allocate a single block of memory for the entire group, then override NewInstance to use part of that larger block for each instance.
Bookmarks