From: Leandro Lucarella Date: Wed, 30 Jun 2010 13:58:20 +0000 (-0300) Subject: Use a few more initial elements by default X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/commitdiff_plain/587bbcb1896f084939cb30c4255de18d37eb6f84?ds=sidebyside;hp=e22e481ad2881b43acdc16fd6061bee9d68270f7 Use a few more initial elements by default Moving from 4 to 16 can improve the performance a little for short lived programs. --- diff --git a/rt/gc/cdgc/dynarray.d b/rt/gc/cdgc/dynarray.d index 2a36d93..5a83217 100644 --- a/rt/gc/cdgc/dynarray.d +++ b/rt/gc/cdgc/dynarray.d @@ -190,7 +190,7 @@ public: if (new_capacity == 0) new_capacity = this._size * 2; if (new_capacity == 0) - new_capacity = 4; + new_capacity = 16; // reallocate the memory with the new_capacity T* new_data = cast(T*) realloc(this._data, new_capacity * T.sizeof); if (new_data is null)