Skip to content

Commit 60995f7

Browse files
authored
Merge pull request #100 from OttoCoddo/main
Clean version
2 parents 5ba244d + 5874300 commit 60995f7

File tree

3 files changed

+27
-284
lines changed

3 files changed

+27
-284
lines changed

entries/ocoddo/src/Project1.lpi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,10 @@
8989
<RunParams>
9090
<FormatVersion Value="2"/>
9191
</RunParams>
92-
<RequiredPackages Count="2">
92+
<RequiredPackages Count="1">
9393
<Item1>
94-
<PackageName Value="SCLLibraries"/>
95-
</Item1>
96-
<Item2>
9794
<PackageName Value="SCL"/>
98-
</Item2>
95+
</Item1>
9996
</RequiredPackages>
10097
<Units Count="1">
10198
<Unit0>

entries/ocoddo/src/Project1.lpr

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
UMemoryBlock,
2121
UThread,
2222
UThreadGroup,
23-
UThreadHelp,
24-
UHashes;
23+
UThreadHelp;
2524

2625
const
2726
MaxCount: UPS = 48 * 1024;
@@ -31,7 +30,6 @@
3130
JumperCount: UPS;
3231
PartSize: UPS;
3332
ProcessorCount: U8;
34-
HashKind: U8;
3533

3634
type
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;

entries/ocoddo/src/UHashes.pas

Lines changed: 0 additions & 261 deletions
This file was deleted.

0 commit comments

Comments
 (0)