You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entries/hgrosser/README.md
+12-21Lines changed: 12 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,42 +3,33 @@
3
3
**1 billion row Challenge entry**
4
4
5
5
## Version
6
-
Version 2.00 (first version with threads)
6
+
Version 2.10 (version with threads, does NOT yet work for 400 stations or 5 billion rows)
7
7
8
8
## How to compile
9
9
The program was developed with FPC 3.2.2 and Lazarus 2.2.4
10
10
11
-
1brc.lpi + 1brc.pas = version without threads
11
+
It uses package **mORMot 2** to compile, which you can download from https://github.com/synopse/mORMot2
12
12
13
-
1brc_th.lpi + 1brc_th.pas = version with threads
13
+
Files to compile: **1brc_th.lpi** and **1brc_th.pas** = this version with threads
14
14
15
15
## How to start
16
16
```
17
-
Usage: <path to input file> <thread count> [<bit-width for hash-list> [buffer size in KB]]
18
-
- thread count: allowed range = [1..32]
17
+
Usage: <path to input file> <thread count> [bit-width for hash-list]
18
+
- thread count: allowed range = [1..64]
19
19
- bit-width for hash-list: sets the size of the hash list, e.g. '16' => 65536 entries,
20
-
allowed range = [16..28], Default=18
21
-
- buffer size in KB: allowed range = [1..2,000,000 KB], Default=128 KB
22
-
Example: hgrosser measurements.txt 32 18 128
20
+
allowed range = [16..28], Default=16
21
+
Example: hgrosser measurements.txt 32 16
23
22
```
24
-
There are no switches like `-i` etc, only 2..4 values.
23
+
There are no switches like `-i` etc, only 2 or 3 values.
25
24
26
-
### Optimizing the 2nd command line parameter
27
-
This parameter sets the thread count. With my own old CPU I could only test 1..4 threads. Although I expect 32 threads to be the fastest, I would be very interested to see the results for 1, 4, 8, 16 and 32 threads. Please use for this test the defaults for the 3rd and 4th command line parameters.
28
-
29
-
### Optimizing the 3rd command line parameter
30
-
In theory the program should run faster with greater bit-widths for the hash-list (because of less collisions). On the computer of Gus - without threads - 18 bits was the fastest. Please try the values from 16 to 20 again and use '32' for the 2nd command line parameter and the default for the 4th command line parameter.
31
-
32
-
### Optimizing the 4th command line parameter
33
-
After the 2nd and 3rd command line parameters had been optimized, please try with them 64, 96, 128, 192 and 256 KB as the 4th command line parameter. Thanks a lot!
25
+
There is no more need for further optimizing. Please use '32' as 2nd command line parameter and '16' as 3rd command line parameter.
34
26
35
27
## How the program works
36
-
The Program works with multi threads.
28
+
The Program works with threads.
37
29
38
30
To speed things up:
39
31
40
-
- the input file is read via procedure 'blockread' ...
41
-
- into an AnsiString, so that function 'PosEx' can be used to parse it
32
+
- the input file is read via **mORMot**'s type 'TMemoryMap'
42
33
- to manage the city names, a self made hash-list is used
43
34
- temperatures are stored as integers (multiplied by 10)
44
35
@@ -50,4 +41,4 @@ To speed things up:
50
41
- Version 1.60: hash-list optimized, some minor improvements, Conditional "noCR" added
51
42
- Version 1.61: Conditional "noCR" constantely enabled => input files must NOT have CR's
52
43
- Version 2.00: 1st version with threads
53
-
44
+
- Version 2.10: the input file is now read via **mORMot**'s type 'TMemoryMap', the hash code is now computed via **mORMot**'s crc32c-function, several small improvements
0 commit comments