>> I prefer the best solution for each platform. If the use of
>> an array of byte will slow down the Win32 version then keep the use
>> of pointer for Win32 and use the array in the .net version. This is
>> important for components like ICS.
>
> I second that, I don't want to give up high speed of ICS Win32 just
> to support .NET which I do not use (and will not use unless a customer
> realy wants it). Any additional move of data in memory slows down
> performance.
Using a dynamic array of byte will not slow down the component if the array
size is not constanly changed. Adressing an element in a fixed array or
dynamic array roughly takes the same time. It is even a little bit faster
(Tested with D7) to access the dynamic array !
procedure TestMe;
var
DA : array of byte;
SA : array [0..2047] of byte;
B1 : Byte;
B2 : Byte;
I : Integer;
J : Integer;
t1, t2, t3 : Cardinal;
begin
SetLength(DA, 2048);
I := 5;
t1 := GetTickCount;
for J := 0 to 100000000 do
B1 := DA[I];
t2 := GetTickCount;
for J := 0 to 100000000 do
B2 := SA[I];
t3 := GetTickCount;
writeln('Dynamic: ', t3 - t2, ' Static: ', t2 - t1);
readln;
end;
You can play with optimization and range checking to see the impact of those
options.
--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be