Skip to content

Commit ca2bf27

Browse files
authored
Merge pull request #104 from hg747/main
hgrosser: hash-list optimized, small improvements in parsing the file
2 parents 2c583bf + afbd4a6 commit ca2bf27

File tree

2 files changed

+215
-97
lines changed

2 files changed

+215
-97
lines changed

entries/hgrosser/README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@
33
**1 billion row Challenge entry**
44

55
## Version
6-
Version 1.0
6+
Version 1.51
77

88
## How to compile
99
The program was developed with FPC 3.2.2 and Lazarus 2.2.4
1010

1111
## How to start
1212
```
13-
Usage: hgrosser <path to input file> [buffer size in kb (Default=128 kb)]
14-
Example: hgrosser ./measurements.txt 128
13+
Usage: <path to input file> <bit-width for hash-list (14..28)>
14+
Example: hgrosser measurements.txt 15
15+
- bit-width for hash-list: sets the size of the hash list, e.g. '16' => 65536 entries
1516
```
1617
There are no switches like `-i` etc, only values.
1718

18-
Please start the program 3 times with buffer sizes of '128', '192' and '256'.
19+
### Optimizing the 2nd command line parameter
20+
21+
In theory the program should run faster with greater bit-widths for the hash-list (because of less collisions), but on my own computer (8 GB RAM) in praxis a small value of 15 is the fastest way, allthough this causes many collisions.
22+
23+
Please (if possible) try all values from 14 to 24 (maybe in a for-loop). Thanks a lot.
1924

2025
## How the program works
2126
The Program works with 1 thread.
@@ -24,5 +29,11 @@ To speed things up:
2429

2530
- the input file is read via procedure 'blockread' ...
2631
- into an AnsiString, so that function 'PosEx' can be used to parse it
27-
- to manage the city names, a 'TFPHashList' is used
32+
- to manage the city names, a self made hash-list is used
2833
- temperatures are stored as integers (multiplied by 10)
34+
35+
## History
36+
37+
- Version 1.00: initial version
38+
- Version 1.50: hash-list optimized, small improvements in parsing the file
39+
- Version 1.51: small improvements in asm function

0 commit comments

Comments
 (0)