Cory Nelson <phrosty gmail com> writes:
Takes 8sec for me (xp3200+ w/ DDR400) when compiled with vs.net 2003. I modified it to use a fixed 10MB heap and it didn't change at all which is quite weird as it shouldn't have had any competition finding memory to expand into. Halving the realloc calls and doubling the alloc sizes got a 2x speed increase though. Windows memory management :( On Tue, 13 Jul 2004 17:21:32 +0200, Petr Pajas <pajas ufal ms mff cuni cz> wrote:$ gcc -o steve2 steve2.c $ time ./steve2 malloc OK (16000) 000: realloc OK (16000 to 32000) 001: realloc OK (32000 to 48000) 002: realloc OK (48000 to 64000) 003: realloc OK (64000 to 80000) <snip> 637: realloc OK (10208000 to 10224000) 638: realloc OK (10224000 to 10240000) 639: realloc OK (10240000 to 10256000) 1 seconds real 0m0.370s user 0m0.000s sys 0m0.030s
Being in a hurry, I forgot to specify, that my results were from Linux, gcc 3.2.2, Pentium 4, 3.20GHz - so it seems a comparable hw. -- Petr
Attachment:
pgp7Esce4w7bw.pgp
Description: PGP signature