kdelibs/kdecore
Michael Matz
kde-optimize@mail.kde.org
Wed, 19 Mar 2003 21:22:14 +0100 (CET)
Hi,
On Wed, 19 Mar 2003, Eray Ozkural wrote:
> I tested this small change but reviews are welcome.
Do you have also measured the performance impact? Does it matter at all?
A note to this change in particular: Usually it's better to have a cut-off
for the increasing of the new size, which basically means, that one
doubles the size up to a certain max size, and after that only adds a
constant amount of new elements, ala:
if sz < 1024
newsz = 2 * sz;
else
newsz = sz + 1024;
This obviously has _much_ better memory usage behaviour while retaining
most of the good aspects of the simple-minded doubling method.
Ciao,
Michael.