@@ -77,6 +77,7 @@ procedure TGenerator.BuildStationNames;
7777 streamReader: TStreamReader;
7878 entry: String;
7979 count: Int64 = 0 ;
80+ start, stop: QWord;
8081begin
8182 WriteLn(' Building Weather Stations...' );
8283 // Load the Weather Station names
@@ -86,6 +87,7 @@ procedure TGenerator.BuildStationNames;
8687 try
8788 streamReader:= TStreamReader.Create(inputStream);
8889 try
90+ start:= GetTickCount64;
8991 while not streamReader.Eof do
9092 begin
9193 entry:= streamReader.ReadLine;
@@ -97,6 +99,7 @@ procedure TGenerator.BuildStationNames;
9799 Inc(count);
98100 end ;
99101 end ;
102+ stop:= GetTickCount64;
100103 finally
101104 streamReader.Free;
102105 end ;
@@ -108,7 +111,11 @@ procedure TGenerator.BuildStationNames;
108111 begin
109112 raise Exception.Create(Format(' File "%s" not found.' , [ FInputFile ]));
110113 end ;
111- WriteLn(' Done.' );
114+ WriteLn(Format(' Done: Processed %d entries from a total of %d weather stations in %d ms' , [
115+ count,
116+ FStationNames.Count,
117+ stop-start
118+ ]));
112119 WriteLn;
113120end ;
114121
@@ -147,7 +154,8 @@ procedure TGenerator.Generate;
147154 progressBatch:= floor(FLineCount * (batchPercent / 100 ));
148155
149156 try
150- outputBufWriter:= TWriteBufStream.Create(outputFileStream, 20 *1024 *1024 );
157+ // outputBufWriter:= TWriteBufStream.Create(outputFileStream, 4*1024);
158+ outputBufWriter:= TWriteBufStream.Create(outputFileStream, 64 *1024 );
151159 try
152160 Write(GenerateProgressBar(1 , FLineCount, 50 ), #13 );
153161 // Generate the file
0 commit comments