Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions entries/ocoddo/src/Project1.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,10 @@
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages Count="2">
<RequiredPackages Count="1">
<Item1>
<PackageName Value="SCLLibraries"/>
</Item1>
<Item2>
<PackageName Value="SCL"/>
</Item2>
</Item1>
</RequiredPackages>
<Units Count="1">
<Unit0>
Expand Down
43 changes: 25 additions & 18 deletions entries/ocoddo/src/Project1.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
UMemoryBlock,
UThread,
UThreadGroup,
UThreadHelp,
UHashes;
UThreadHelp;

const
MaxCount: UPS = 48 * 1024;
Expand All @@ -31,7 +30,6 @@
JumperCount: UPS;
PartSize: UPS;
ProcessorCount: U8;
HashKind: U8;

type
THash = U32;
Expand Down Expand Up @@ -82,22 +80,34 @@ TStationSummary = record
Result := A.Name > B.Name;
end;

//Perfect quality, no repeat for this dataset
function FNV1a32Custom(P: PChar; L: NChar): U32; inline;
begin
Result := 2166136261;
while L >= 4 do
begin
Result := (Result xor PU32(P)^) * 16777619;
P += 3;
L -= 3;
end;
while L >= 2 do
begin
Result := (Result xor PU16(P)^) * 16777619;
P += 2;
L -= 2;
end;
if L = 1 then
Result := (Result xor PU8(P)^) * 16777619;
end;

function FindOrAdd(P: PChar; NS, NE: NChar; var ACoordinator: TCoordinator): Ind; inline; overload;
var
H: THash;
I: Ind;
JN: TJumper;
begin
//Perfect quality, no repeat for this dataset
case HashKind of
0: H := xxHash32C(P + NS, NE - NS + 1);
1: H := FNV1a32(P + NS, NE - NS + 1);
2: H := FNV1a32Custom(P + NS, NE - NS + 1);
3: H := crc32csse42(0, P + NS, NE - NS + 1);
4: H := crc32c(P + NS, NE - NS + 1);
5: H := crc32c2(P + NS, NE - NS + 1);
6: H := xxHash(PByte(P + NS), NE - NS + 1);
end;
H := FNV1a32Custom(P + NS, NE - NS + 1);

I := H and (JumperCount - 1); //Index in Jumpers

with ACoordinator do
Expand Down Expand Up @@ -405,9 +415,8 @@ TStationSummary = record
end;

ProcessorCount := LogicalProcessorCount;
JumperCount := 256 * 1024;
PartSize := 192 * 1024 - ReadMargin;
HashKind := 0;
JumperCount := 128 * 1024;
PartSize := 128 * 1024 - ReadMargin;

for I := 0 to High(Parameters) do
begin
Expand All @@ -420,8 +429,6 @@ TStationSummary = record
PartSize := (V * 1024) - ReadMargin
else if N = 'processor-count' then
ProcessorCount := V
else if N = 'hash-kind' then
HashKind := V
else if N = 'help' then
begin
WriteHelp;
Expand Down
261 changes: 0 additions & 261 deletions entries/ocoddo/src/UHashes.pas

This file was deleted.