@@ -77,6 +77,7 @@ procedure TGenerator.BuildStationNames;
77
77
streamReader: TStreamReader;
78
78
entry: String;
79
79
count: Int64 = 0 ;
80
+ start, stop: QWord;
80
81
begin
81
82
WriteLn(' Building Weather Stations...' );
82
83
// Load the Weather Station names
@@ -86,6 +87,7 @@ procedure TGenerator.BuildStationNames;
86
87
try
87
88
streamReader:= TStreamReader.Create(inputStream);
88
89
try
90
+ start:= GetTickCount64;
89
91
while not streamReader.Eof do
90
92
begin
91
93
entry:= streamReader.ReadLine;
@@ -97,6 +99,7 @@ procedure TGenerator.BuildStationNames;
97
99
Inc(count);
98
100
end ;
99
101
end ;
102
+ stop:= GetTickCount64;
100
103
finally
101
104
streamReader.Free;
102
105
end ;
@@ -108,7 +111,11 @@ procedure TGenerator.BuildStationNames;
108
111
begin
109
112
raise Exception.Create(Format(' File "%s" not found.' , [ FInputFile ]));
110
113
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
+ ]));
112
119
WriteLn;
113
120
end ;
114
121
@@ -147,7 +154,8 @@ procedure TGenerator.Generate;
147
154
progressBatch:= floor(FLineCount * (batchPercent / 100 ));
148
155
149
156
try
150
- outputBufWriter:= TWriteBufStream.Create(outputFileStream, 20 *1024 *1024 );
157
+ // outputBufWriter:= TWriteBufStream.Create(outputFileStream, 4*1024);
158
+ outputBufWriter:= TWriteBufStream.Create(outputFileStream, 64 *1024 );
151
159
try
152
160
Write(GenerateProgressBar(1 , FLineCount, 50 ), #13 );
153
161
// Generate the file
0 commit comments