2020 UMemoryBlock,
2121 UThread,
2222 UThreadGroup,
23- UThreadHelp,
24- UHashes;
23+ UThreadHelp;
2524
2625const
2726 MaxCount: UPS = 48 * 1024 ;
3130 JumperCount: UPS;
3231 PartSize: UPS;
3332 ProcessorCount: U8;
34- HashKind: U8;
3533
3634type
3735 THash = U32;
@@ -82,22 +80,34 @@ TStationSummary = record
8280 Result := A.Name > B.Name ;
8381 end ;
8482
83+ // Perfect quality, no repeat for this dataset
84+ function FNV1a32Custom (P: PChar; L: NChar): U32; inline;
85+ begin
86+ Result := 2166136261 ;
87+ while L >= 4 do
88+ begin
89+ Result := (Result xor PU32(P)^) * 16777619 ;
90+ P += 3 ;
91+ L -= 3 ;
92+ end ;
93+ while L >= 2 do
94+ begin
95+ Result := (Result xor PU16(P)^) * 16777619 ;
96+ P += 2 ;
97+ L -= 2 ;
98+ end ;
99+ if L = 1 then
100+ Result := (Result xor PU8(P)^) * 16777619 ;
101+ end ;
102+
85103 function FindOrAdd (P: PChar; NS, NE: NChar; var ACoordinator: TCoordinator): Ind; inline; overload;
86104 var
87105 H: THash;
88106 I: Ind;
89107 JN: TJumper;
90108 begin
91- // Perfect quality, no repeat for this dataset
92- case HashKind of
93- 0 : H := xxHash32C(P + NS, NE - NS + 1 );
94- 1 : H := FNV1a32(P + NS, NE - NS + 1 );
95- 2 : H := FNV1a32Custom(P + NS, NE - NS + 1 );
96- 3 : H := crc32csse42(0 , P + NS, NE - NS + 1 );
97- 4 : H := crc32c(P + NS, NE - NS + 1 );
98- 5 : H := crc32c2(P + NS, NE - NS + 1 );
99- 6 : H := xxHash(PByte(P + NS), NE - NS + 1 );
100- end ;
109+ H := FNV1a32Custom(P + NS, NE - NS + 1 );
110+
101111 I := H and (JumperCount - 1 ); // Index in Jumpers
102112
103113 with ACoordinator do
@@ -405,9 +415,8 @@ TStationSummary = record
405415 end ;
406416
407417 ProcessorCount := LogicalProcessorCount;
408- JumperCount := 256 * 1024 ;
409- PartSize := 192 * 1024 - ReadMargin;
410- HashKind := 0 ;
418+ JumperCount := 128 * 1024 ;
419+ PartSize := 128 * 1024 - ReadMargin;
411420
412421 for I := 0 to High(Parameters) do
413422 begin
@@ -420,8 +429,6 @@ TStationSummary = record
420429 PartSize := (V * 1024 ) - ReadMargin
421430 else if N = ' processor-count' then
422431 ProcessorCount := V
423- else if N = ' hash-kind' then
424- HashKind := V
425432 else if N = ' help' then
426433 begin
427434 WriteHelp;
0 commit comments