Skip to content

Commit 1919a8e

Browse files
committed
Update - Added a comment.
1 parent 24fa259 commit 1919a8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

entries/ikelaiah/src/weatherstation.pas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

3637
type
@@ -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;
450451
begin
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;

0 commit comments

Comments
 (0)