Skip to content

Commit 5856440

Browse files
committed
input files must NOT have CR's
1 parent 4bfc1f9 commit 5856440

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

entries/hgrosser/README.md

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

55
## Version
6-
Version 1.60
6+
Version 1.61
77

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

11-
There is a new Conditional "noCR" which is neccessary, if the input file has no CR's
12-
1311
## How to start
1412
```
1513
Usage: <path to input file> <bit-width for hash-list (16..28)>
1614
Example: hgrosser measurements.txt 16
15+
- input file: must NOT have CR's (only LF's)
1716
- bit-width for hash-list: sets the size of the hash list, e.g. '16' => 65536 entries
1817
```
1918
There are no switches like `-i` etc, only 2 values.
@@ -40,3 +39,4 @@ To speed things up:
4039
- Version 1.50: hash-list optimized, small improvements in parsing the file
4140
- Version 1.51: small improvements in asm function
4241
- Version 1.60: hash-list optimized, some minor improvements, Conditional "noCR" added
42+
- Version 1.61: Conditional "noCR" constantely enabled => input files must NOT have CR's

entries/hgrosser/src/1brc.pas

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{ $DEFINE XTEST} {please keep this UNDEFINED / compile a safe or a fast program}
66
{ $DEFINE XINLINE} {please keep this UNDEFINED / use INLINE for routines or not}
7-
{ $DEFINE noCR} {neccessary for input-files without CR's (only LF's)}
7+
{$DEFINE noCR} {neccessary for input-files without CR's (only LF's)}
88

99
{$IFDEF XTEST}
1010
{$R+} {$Q+} {$S+} {slow but safe}
@@ -21,7 +21,7 @@
2121
sysutils, strutils, math;
2222

2323
const
24-
M_version = '1.60'; {version number}
24+
M_version = '1.61'; {version number}
2525

2626
{------------------------------ Common routines: ------------------------------}
2727

@@ -520,10 +520,7 @@ procedure weatherClass.process_measurements;
520520
begin
521521
Inc(p2, pred(p1)); {p2:=position of 'LF'}
522522
{get cityname and temperature, without CR: }
523-
len := p2 - p1
524-
{$IFNDEF noCR}
525-
- 1;
526-
{$ENDIF} {'-1' skips the CR}
523+
len := p2 - p1 {$IFNDEF noCR} -1 {$ENDIF} ; {'-1' skips the CR}
527524
city[0] := chr(len);
528525
move(s[p1], city[1], len);
529526
{extract temperature: }

0 commit comments

Comments
 (0)