The fewer things you have new, the less things you need to collect.
Suppose you have class A. You can include a reference to another instance of class A in this way. So you can make a βfree listβ of instances of A. Whenever you need A, just pick one from the free list. If the free list is empty, then newone.
When you no longer need it, click it in the free list.
It can save a lot of time.
source
share