]> git.llucax.com Git - software/dgc/cdgc.git/commitdiff
Use a few more initial elements by default
authorLeandro Lucarella <llucax@gmail.com>
Wed, 30 Jun 2010 13:58:20 +0000 (10:58 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Wed, 30 Jun 2010 13:58:20 +0000 (10:58 -0300)
Moving from 4 to 16 can improve the performance a little for short lived
programs.

rt/gc/cdgc/dynarray.d

index 2a36d9342123fb80569754b6ed7f19138f7d20f1..5a83217fba9b0bf519c5cc3addccb9018e4b6143 100644 (file)
@@ -190,7 +190,7 @@ public:
         if (new_capacity == 0)
             new_capacity = this._size * 2;
             if (new_capacity == 0)
         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)
         // reallocate the memory with the new_capacity
         T* new_data = cast(T*) realloc(this._data, new_capacity * T.sizeof);
         if (new_data is null)