Re: Streams




A little Test Program show below, once it gets over 1000 lines, it slows WAY
down. String Streams do not seem to be the way to handle this, do they? It
will process about 1000 strings in 0 seconds, 2000 strings takes 20 seconds.
I have to do 43200 lines.

procedure TForm1.Button1Click(Sender: TObject);
Var
str : TStringStream;
x, Y : Integer;
s : String;
aZip : tAbZipper;
StartTime, EndTime : TDateTime;

begin
StartTime := now;
Str := tStringStream.Create(s);

ProgressBar1.Min := 1;
ProgressBar1.Max := 5000;
ProgressBar1.StepBy(100);

For x := 1 to 5000 do
Begin
For Y := 1 to 60 do
Str.WriteString(IntToStr(x)+ ',');
Str.WriteString(#13#10);
ProgressBar1.Position := x;
Application.ProcessMessages;
End;

aZip := TAbZipper.Create(nil);
azip.FileName := 'd:\Test.Zip';
azip.AddFromStream('d:\test.csv', Str);
azip.Save;
azip.CloseArchive;
azip.Free;
EndTime := Now;
ShowMessage('It took '+ IntToStr(SecondsBetween(StartTime,EndTime)) + '
Seconds');

Str.Free;


end;




----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.


Quantcast