My results :

_Ptr:=GetMem(100000000)        18 mus, 824 ns / GetMem
_Ptr:=GetMem(100000000) + FillChar(_Ptr^,100000000,0)); 81 ms / GetMem + 
FillChar

var
  ArInt:array of int32;
.
SetLength(ArInt, 100000000 shr 2);         81 ms / SetLength

All timings are variable within [time, time+8%] on repeated runs as is 
generally the case for system timings.

SetLength 0's (Internally calls FillChar) the array ArInt so to do a identical 
comparison you need to add the FillChar to the GetMem if it is your intention 
to 0 the array before using it.

You have to compare things that do the same thing in the end.

Tested on XP Pro Win32 Sp3
Intel Core 2CPU
6400 #@ 2.13GHz
2.05 GHr., 1.00 Gb RAM
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to