What I mean is this - is allocating small memory chunks faster than allocating big ones? I.e.:
int * dummy = new int; // A
int * dummy2 = new int[2]; // A
int * dummy3 = new int[1000000]; // B
VeryVeryBigStruct * dummy4 = new VeryVeryBigStruct; // B
(A)
Would be small allocations, (B)
would be big ones.
I know I could just write a simple program and test it for myself but I actually tried and even QueryPerformanceCounter()
returned 0
time for single small allocation (which is a little surprising since all allocations are supposedly so slow. Besides, 1 test on 1 computer is hardly reliable so I would like to hear what you know on the matter.
Also, I would like to know if 10 allocations of N
bytes are faster/slower than 1 allocation of 10 * N
bytes (I would say it should be slower but who knows).