File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ TStat = record
3131 const newSum: int64; const newCount: int64);
3232 function ToString : string;
3333 end ;
34+ { Using pointer to TStat saves approx. 30-60 seconds for processing 1 billion rows}
3435 PStat = ^TStat;
3536
3637type
@@ -306,7 +307,7 @@ procedure TWeatherStation.ReadMeasurements;
306307 // Open the file for reading
307308 fileStream := TFileStream.Create(self.fname, fmOpenRead or fmShareDenyNone);
308309 try
309- streamReader := TStreamReader.Create(fileStream, 655360 , False);
310+ streamReader := TStreamReader.Create(fileStream, 65536 * 2 , False);
310311 try
311312 // Read and parse chunks of data until EOF -------------------------------
312313 while not streamReader.EOF do
@@ -450,7 +451,8 @@ procedure TWeatherStation.ProcessMeasurements;
450451begin
451452 self.ReadMeasurements;
452453 // self.ReadMeasurementsClassic;
453- { This chunking method cuts ~ 30 - 40 seconds of processing time from ~6.45 to 6.00}
454+ { This chunking method cuts ~ 30 - 40 seconds of processing time from ~6.45 to 6.00
455+ But the SHA256 at the end is incorrect}
454456 // self.ReadMeasurementsInChunks(self.fname);
455457 self.SortWeatherStationAndStats;
456458 self.PrintSortedWeatherStationAndStats;
You can’t perform that action at this time.
0 commit comments