Skip to content

Commit 1e200be

Browse files
committed
new HASHMULT build to test a different hash function
1 parent ff21ea0 commit 1e200be

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

entries/ghatem-fpc/src/OneBRCproj.lpi

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<UseAppBundle Value="False"/>
1616
<ResourceType Value="res"/>
1717
</General>
18-
<BuildModes Count="4">
18+
<BuildModes Count="5">
1919
<Item1 Name="Default" Default="True"/>
2020
<Item2 Name="Debug">
2121
<CompilerOptions>
@@ -108,6 +108,35 @@
108108
</Other>
109109
</CompilerOptions>
110110
</Item4>
111+
<Item5 Name="HashMult">
112+
<CompilerOptions>
113+
<Version Value="11"/>
114+
<PathDelim Value="\"/>
115+
<Target>
116+
<Filename Value="..\..\..\bin\ghatem"/>
117+
</Target>
118+
<SearchPaths>
119+
<IncludeFiles Value="$(ProjOutDir)"/>
120+
<UnitOutputDirectory Value="..\..\..\bin\lib\$(TargetCPU)-$(TargetOS)"/>
121+
</SearchPaths>
122+
<CodeGeneration>
123+
<SmartLinkUnit Value="True"/>
124+
<Optimizations>
125+
<OptimizationLevel Value="3"/>
126+
</Optimizations>
127+
</CodeGeneration>
128+
<Linking>
129+
<Debugging>
130+
<GenerateDebugInfo Value="False"/>
131+
<RunWithoutDebug Value="True"/>
132+
</Debugging>
133+
<LinkSmart Value="True"/>
134+
</Linking>
135+
<Other>
136+
<CustomOptions Value="-dRELEASE -dHASHMULT"/>
137+
</Other>
138+
</CompilerOptions>
139+
</Item5>
111140
</BuildModes>
112141
<PublishOptions>
113142
<Version Value="2"/>

entries/ghatem-fpc/src/onebrc.pas

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,13 @@ procedure TMyDictionary.InternalFind(const aKey: Cardinal; out aFound: Boolean;
136136
vDbl: Double;
137137
vOffset: Integer;
138138
begin
139+
{$IFDEF HASHMULT}
139140
vDbl := aKey * cHashConst;
140141
vDbl := vDbl - Trunc (vDbl);
141142
vIdx := Trunc (vDbl * cDictSize);
143+
{$ELSE}
144+
vIdx := aKey mod cDictSize;
145+
{$ENDIF}
142146

143147
aFound := False;
144148

0 commit comments

Comments
 (0)