????
Seh ich da was nicht?
Ich hab mal schnell den gepufferten Stream getestet und die Performance ist noch deutlich schlechter.
"normal" = 1671
"buffered" = 4187
Delphi-Quellcode:
uses JclStreams;
procedure TForm1.Button1Click(Sender: TObject);
var counter : integer;
StartTime : LongWord;
{DEFINE UseBufferendStream}
{$IFNDEF UseBufferendStream}
fs : TFileStream;
{$ELSE}
fs : TJclBufferedStream;
{$ENDIF}
by : byte;
const CIterations = 1000000;
begin
StartTime:=GetTickCount;
by:=$0f;
{$IFNDEF UseBufferendStream}
fs := TFileStream.Create( 'C:\test.txt', fmCreate or fmShareDenyWrite );
{$ELSE}
fs := TJclBufferedStream.Create(TFileStream.Create( 'C:\test.txt', fmCreate or fmShareDenyWrite ), True);
{$ENDIF}
try
for counter:=0 to CIterations-1 do
fs.write(by, sizeof(by));
finally
fs.Free;
end;
Caption:=IntToStr(GetTickCount - StartTime);
end;