File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,11 @@ Iwan Kelaiah
136136 * Use ` ShortString ` whenever possible. This saves approx 20 seconds.
137137 * Pre-allocate initial size for dictionaries. saves approx 20 seconds.
138138
139+ * 1.10
140+ * Revision release - Sequential approach. 3-5 mins on my Inspiron 15 7510 laptop, around 2m55s (a little improvement on speed).
141+ * Reduced buffer for ` TStreamReader ` to ` 65536 * 2 ` . This saves approx 5 seconds.
142+ * Changed hashmap from ` TGHashMapLP ` (linear probing) to ` TGHashMapQP ` (quadratic probing). This saves approx 5 seconds.
143+
139144## License
140145
141146This project is licensed under the MIT License - see the LICENSE.md file for details
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ TStat = record
3535
3636type
3737 // Using this dictionary, now approx 4 mins faster than Generics.Collections.TDictionary
38- TWeatherDictionaryLG = specialize TGHashMapLP <ShortString, PStat>;
38+ TWeatherDictionaryLG = specialize TGHashMapQP <ShortString, PStat>;
3939
4040type
4141 // a type for storing valid lookup temperature
42- TValidTemperatureDictionary = specialize TGHashMapLP <ShortString, int64>;
42+ TValidTemperatureDictionary = specialize TGHashMapQP <ShortString, int64>;
4343
4444type
4545 // Create a class to encapsulate the temperature observations of each weather station.
@@ -322,7 +322,7 @@ procedure TWeatherStation.ReadMeasurements;
322322 // Open the file for reading
323323 fileStream := TFileStream.Create(self.fname, fmOpenRead);
324324 try
325- streamReader := TStreamReader.Create(fileStream, 65536 * 32 , False);
325+ streamReader := TStreamReader.Create(fileStream, 65536 * 2 , False);
326326 try
327327 // Read and parse chunks of data until EOF -------------------------------
328328 while not streamReader.EOF do
You can’t perform that action at this time.
0 commit comments