Skip to content

Commit 9d0237f

Browse files
committed
undo the dict-size parameter
1 parent 82d1f50 commit 9d0237f

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

entries/ghatem-fpc/src/OneBRCproj.lpr

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ TOneBRCApp = class(TCustomApplication)
1818
private
1919
FFileName: string;
2020
FThreadCount: Integer;
21-
FDictSize: Integer;
2221
procedure RunOneBRC;
2322
protected
2423
procedure DoRun; override;
@@ -34,7 +33,7 @@ procedure TOneBRCApp.RunOneBRC;
3433
var
3534
vOneBRC: TOneBRC;
3635
begin
37-
vOneBRC := TOneBRC.Create (FThreadCount, FDictSize);
36+
vOneBRC := TOneBRC.Create (FThreadCount);
3837
try
3938
try
4039
vOneBRC.mORMotMMF(FFileName);
@@ -89,17 +88,15 @@ procedure TOneBRCApp.DoRun;
8988
ErrorMsg: String;
9089
begin
9190
// quick check parameters
92-
ErrorMsg:= CheckOptions(Format('%s%s%s%s%s:',[
91+
ErrorMsg:= CheckOptions(Format('%s%s%s%s:',[
9392
cShortOptHelp,
9493
cShortOptThread,
95-
cShortOptDictSize,
9694
cShortOptVersion,
9795
cShortOptInput
9896
]),
9997
[
10098
cLongOptHelp,
10199
cLongOptThread+':',
102-
cLongOptDictSize+':',
103100
cLongOptVersion,
104101
cLongOptInput+':'
105102
]
@@ -129,11 +126,6 @@ procedure TOneBRCApp.DoRun;
129126
FThreadCount := StrToInt (GetOptionValue(cShortOptThread, cLongOptThread));
130127
end;
131128

132-
FDictSize := 45003;
133-
if HasOption(cShortOptDictSize, cLongOptDictSize) then begin
134-
FDictSize := StrToInt (GetOptionValue(cShortOptDictSize, cLongOptDictSize));
135-
end;
136-
137129
if HasOption(cShortOptInput, cLongOptInput) then begin
138130
FFileName := GetOptionValue(
139131
cShortOptInput,

entries/ghatem-fpc/src/baseline.console.pas

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ interface
2121
cLongOptInput = 'input-file';
2222
cShortOptThread: Char = 't';
2323
cLongOptThread = 'threads';
24-
cShortOptDictSize: Char = 's';
25-
cLongOptDictSize = 'size';
2624
{$ELSE}
2725
cOptionHelp: array of string = ['-h', '--help'];
2826
cOptionVersion: array of string = ['-v', '--version'];

entries/ghatem-fpc/src/onebrc.pas

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ interface
1010

1111
function RoundExDouble(const ATemp: Double): Double; inline;
1212

13-
{$WRITEABLECONST ON}
1413
const
15-
cDictSize: Integer = 45003;
16-
{$WRITEABLECONST OFF}
14+
cDictSize: Integer = 45007;
1715

1816
type
1917

@@ -62,10 +60,10 @@ TOneBRC = class
6260
FThreads: array of TThread;
6361
FStationsDicts: array of TMyDictionary;
6462

65-
procedure ExtractLineData(const aStart: Int64; const aEnd: Int64; out aLength: ShortInt; out aTemp: SmallInt); inline;
63+
procedure ExtractLineData(const aStart: Int64; const aEnd: Int64; out aLength: ShortInt; out aTemp: SmallInt);
6664

6765
public
68-
constructor Create (const aThreadCount: UInt16; const aDictSize: Integer);
66+
constructor Create (const aThreadCount: UInt16);
6967
destructor Destroy; override;
7068
function mORMotMMF (const afilename: string): Boolean;
7169
procedure DispatchThreads;
@@ -251,11 +249,9 @@ procedure TOneBRC.ExtractLineData(const aStart: Int64; const aEnd: Int64; out aL
251249

252250
//---------------------------------------------------
253251

254-
constructor TOneBRC.Create (const aThreadCount: UInt16; const aDictSize: Integer);
252+
constructor TOneBRC.Create (const aThreadCount: UInt16);
255253
var I: UInt16;
256254
begin
257-
cDictSize := aDictSize;
258-
259255
FThreadCount := aThreadCount;
260256
SetLength (FStationsDicts, aThreadCount);
261257
SetLength (FThreads, aThreadCount);

0 commit comments

Comments
 (0)