BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New benchmark: ArrayUpsizeSingleThread.pas

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM
View previous topic :: View next topic  
Author Message
Thorsten Engler [NexusDB]
Guest





PostPosted: Sun Mar 06, 2005 12:47 am    Post subject: New benchmark: ArrayUpsizeSingleThread.pas Reply with quote



Posted to attachments.

Constantly resize a dynamic array in single steps upward to reproduce
JclDebug behaviour when loading debug information.

Cheers,
Thorsten


Back to top
Robert Houdart
Guest





PostPosted: Sun Mar 06, 2005 6:32 pm    Post subject: Re: New benchmark: ArrayUpsizeSingleThread.pas Reply with quote



Hi Thorsten,
I'll add the benchmark to B&V 0.27. In accordance with the suggested rule,
it should also effectively use the memory it allocates. Do you agree with
the following code ?

for i := 0 to 10 * 1024 * 1024 do begin
SetLength(x, i);
x[i - 1] := i;
end;

Cheers,
Robert


Back to top
Thorsten Engler [NexusDB]
Guest





PostPosted: Sun Mar 06, 2005 10:14 pm    Post subject: Re: New benchmark: ArrayUpsizeSingleThread.pas Reply with quote



Quote:
for i := 0 to 10 * 1024 * 1024 do begin
SetLength(x, i);
if i > 0 then
x[i - 1] := i;
end;

Cheers,
Thorsten



Back to top
Dan Downs
Guest





PostPosted: Sun Mar 06, 2005 11:59 pm    Post subject: Re: New benchmark: ArrayUpsizeSingleThread.pas Reply with quote

Why not just


SetLength(x, 0);
for i := 1 to 10 * 1024 * 1024 do begin
SetLength(x, i);
x[i - 1] := i;
end;


DD


Back to top
Thorsten Engler [NexusDB]
Guest





PostPosted: Mon Mar 07, 2005 12:22 am    Post subject: Re: New benchmark: ArrayUpsizeSingleThread.pas Reply with quote

Quote:
Why not just

SetLength(x, 0);
for i := 1 to 10 * 1024 * 1024 do begin
SetLength(x, i);
x[i - 1] := i;
end;

Why did the chicken cross the road?

.....

Works fine for me too...



Back to top
Dan Downs
Guest





PostPosted: Mon Mar 07, 2005 5:43 pm    Post subject: Re: New benchmark: ArrayUpsizeSingleThread.pas Reply with quote

Quote:
Why not just

SetLength(x, 0);
for i := 1 to 10 * 1024 * 1024 do begin
SetLength(x, i);
x[i - 1] := i;
end;

Why did the chicken cross the road?

To get rid of the if statement inside the loop. Granted it'll be spending
most of its time resizing x, but maybe, just maybe it'll save enough time to
fry up that chicken. <g>

DD



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.