Skip to content

Commit 201bdbe

Browse files
committed
Update - Changed size of chunk.
1 parent 9465399 commit 201bdbe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

entries/ikelaiah/src/weatherstation.pas

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,10 @@ procedure TWeatherStation.ReadMeasurementsInChunks(const filename: string);
400400
buffer: pansichar;
401401
bytesRead, totalBytesRead, chunkSize, lineBreakPos, chunkIndex: int64;
402402
begin
403+
404+
// chunkSize := defaultChunkSize * 2; // Now 128MB in bytes ~ 5.52 :D
405+
// chunkSize := defaultChunkSize * 4; // Now 256MB in bytes ~ 5.50 :D
403406
chunkSize := defaultChunkSize * 4 * 4; // Now 1GB in bytes ~ 5:53 :D
404-
// chunkSize := defaultChunkSize * 4; // Now 512GB in bytes ~ 5.50 :D
405407

406408
// Open the file for reading
407409
fileStream := TFileStream.Create(filename, fmOpenRead or fmShareDenyWrite);
@@ -465,7 +467,8 @@ procedure TWeatherStation.ProcessMeasurements;
465467
begin
466468
// self.ReadMeasurements;
467469
// self.ReadMeasurementsClassic;
468-
self.ReadMeasurementsInChunks(self.fname); {This method cuts ~ 30 - 40 seconds of processing time from ~6.45 to 6.00}
470+
self.ReadMeasurementsInChunks(self.fname);
471+
{This method cuts ~ 30 - 40 seconds of processing time from ~6.45 to 6.00}
469472
self.SortWeatherStationAndStats;
470473
self.PrintSortedWeatherStationAndStats;
471474
end;

0 commit comments

Comments
 (0)