From 587bbcb1896f084939cb30c4255de18d37eb6f84 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 30 Jun 2010 10:58:20 -0300 Subject: [PATCH] Use a few more initial elements by default Moving from 4 to 16 can improve the performance a little for short lived programs. --- rt/gc/cdgc/dynarray.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.43.0