Skip to content

Commit df4d079

Browse files
committed
benchmark related fixes
1 parent fcddf68 commit df4d079

14 files changed

Lines changed: 44 additions & 38 deletions

.github/workflows/make.pas

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,16 +2251,22 @@ function TMakeRunner.IsTestProject(const ALpiPath: string): Boolean;
22512251

22522252
function TMakeRunner.IsBenchmarkProject(const ALpiPath: string): Boolean;
22532253
var
2254-
LprPath, Content: string;
2254+
LprPath, Content, ProjectBaseName: string;
22552255
begin
22562256
Result := False;
2257-
if Pos('PerformanceBenchmark', ALpiPath) > 0 then
2257+
if not SameText(ExtractFileExt(ALpiPath), '.lpi') then
2258+
Exit;
2259+
2260+
ProjectBaseName := ChangeFileExt(ExtractFileName(ALpiPath), '');
2261+
if Pos('BenchmarkConsole', ProjectBaseName) > 0 then
22582262
Exit(True);
2263+
22592264
LprPath := ChangeFileExt(ALpiPath, '.lpr');
22602265
if not FileExists(LprPath) then
22612266
Exit;
2267+
22622268
Content := TLazXml.ReadFile(LprPath);
2263-
Result := Pos('uPerformanceBenchmark', Content) > 0;
2269+
Result := Pos('TPerformanceBenchmark.Run', Content) > 0;
22642270
end;
22652271

22662272
procedure TMakeRunner.RunTestProject(const APath: string);

.github/workflows/make.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ env:
4646
MAKE_DEFINES: ''
4747
# When true, make.pas builds and runs console benchmarks after the test suite.
4848
# Override per job below, like MAKE_BUILD_BACKEND.
49-
MAKE_RUN_BENCHMARK: false
49+
MAKE_RUN_BENCHMARK: true
5050
# Set by the workflow_dispatch "debug" toggle; '1' enables `set -x` tracing in
5151
# install-fpc-lazarus.sh, '0' otherwise. Forwarded into the sandboxed jobs below.
5252
CI_DEBUG: ${{ github.event.inputs.debug == 'true' && '1' || '0' }}

HashLib.Benchmark/Delphi/PerformanceBenchmarkConsole.dpr renamed to HashLib.Benchmark/Delphi/HashLib.BenchmarkConsole.dpr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
program PerformanceBenchmarkConsole;
1+
program HashLib.BenchmarkConsole;
22

33
{$APPTYPE CONSOLE}
44

55
uses
66
Classes,
77
SysUtils,
8-
uBenchmarkCommon in '..\src\Core\uBenchmarkCommon.pas',
9-
uHashPerformanceBenchmark in '..\src\Core\uHashPerformanceBenchmark.pas',
10-
uKdfPerformanceBenchmark in '..\src\Core\uKdfPerformanceBenchmark.pas',
11-
uPerformanceBenchmark in '..\src\Core\uPerformanceBenchmark.pas',
8+
BenchmarkCommon in '..\src\Core\BenchmarkCommon.pas',
9+
HashPerformanceBenchmark in '..\src\Core\HashPerformanceBenchmark.pas',
10+
KdfPerformanceBenchmark in '..\src\Core\KdfPerformanceBenchmark.pas',
11+
PerformanceBenchmark in '..\src\Core\PerformanceBenchmark.pas',
1212
HlpHash in '..\..\HashLib\src\Base\HlpHash.pas',
1313
HlpKDF in '..\..\HashLib\src\Base\HlpKDF.pas',
1414
HlpHashBuffer in '..\..\HashLib\src\Base\HlpHashBuffer.pas',

HashLib.Benchmark/Delphi/PerformanceBenchmarkFMX.dpr renamed to HashLib.Benchmark/Delphi/HashLib.BenchmarkFMX.dpr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
program PerformanceBenchmarkFMX;
1+
program HashLib.BenchmarkFMX;
22

33
uses
44
System.StartUpCopy,
55
FMX.Forms,
66
fmxMainForm in '..\src\Forms\FMX\fmxMainForm.pas' {MainForm},
7-
uBenchmarkCommon in '..\src\Core\uBenchmarkCommon.pas',
8-
uHashPerformanceBenchmark in '..\src\Core\uHashPerformanceBenchmark.pas',
9-
uKdfPerformanceBenchmark in '..\src\Core\uKdfPerformanceBenchmark.pas',
10-
uPerformanceBenchmark in '..\src\Core\uPerformanceBenchmark.pas',
7+
BenchmarkCommon in '..\src\Core\BenchmarkCommon.pas',
8+
HashPerformanceBenchmark in '..\src\Core\HashPerformanceBenchmark.pas',
9+
KdfPerformanceBenchmark in '..\src\Core\KdfPerformanceBenchmark.pas',
10+
PerformanceBenchmark in '..\src\Core\PerformanceBenchmark.pas',
1111
HlpHash in '..\..\HashLib\src\Base\HlpHash.pas',
1212
HlpKDF in '..\..\HashLib\src\Base\HlpKDF.pas',
1313
HlpHashBuffer in '..\..\HashLib\src\Base\HlpHashBuffer.pas',

HashLib.Benchmark/Lazarus/PerformanceBenchmarkConsole.lpi renamed to HashLib.Benchmark/Lazarus/HashLib.BenchmarkConsole.lpi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<CompatibilityMode Value="True"/>
1212
</Flags>
1313
<SessionStorage Value="InProjectDir"/>
14-
<Title Value="PerformanceBenchmarkConsole"/>
14+
<Title Value="HashLib.BenchmarkConsole"/>
1515
<UseAppBundle Value="False"/>
1616
<ResourceType Value="res"/>
1717
</General>
@@ -22,7 +22,7 @@
2222
<Version Value="11"/>
2323
<PathDelim Value="\"/>
2424
<Target>
25-
<Filename Value="PerformanceBenchmarkConsole"/>
25+
<Filename Value="HashLib.BenchmarkConsole"/>
2626
</Target>
2727
<SearchPaths>
2828
<IncludeFiles Value="$(ProjOutDir)"/>
@@ -70,23 +70,23 @@
7070
</RequiredPackages>
7171
<Units Count="5">
7272
<Unit0>
73-
<Filename Value="PerformanceBenchmarkConsole.lpr"/>
73+
<Filename Value="HashLib.BenchmarkConsole.lpr"/>
7474
<IsPartOfProject Value="True"/>
7575
</Unit0>
7676
<Unit1>
77-
<Filename Value="..\src\Core\uPerformanceBenchmark.pas"/>
77+
<Filename Value="..\src\Core\PerformanceBenchmark.pas"/>
7878
<IsPartOfProject Value="True"/>
7979
</Unit1>
8080
<Unit2>
81-
<Filename Value="..\src\Core\uBenchmarkCommon.pas"/>
81+
<Filename Value="..\src\Core\BenchmarkCommon.pas"/>
8282
<IsPartOfProject Value="True"/>
8383
</Unit2>
8484
<Unit3>
85-
<Filename Value="..\src\Core\uHashPerformanceBenchmark.pas"/>
85+
<Filename Value="..\src\Core\HashPerformanceBenchmark.pas"/>
8686
<IsPartOfProject Value="True"/>
8787
</Unit3>
8888
<Unit4>
89-
<Filename Value="..\src\Core\uKdfPerformanceBenchmark.pas"/>
89+
<Filename Value="..\src\Core\KdfPerformanceBenchmark.pas"/>
9090
<IsPartOfProject Value="True"/>
9191
</Unit4>
9292
</Units>
@@ -95,7 +95,7 @@
9595
<Version Value="11"/>
9696
<PathDelim Value="\"/>
9797
<Target>
98-
<Filename Value="PerformanceBenchmarkConsole"/>
98+
<Filename Value="HashLib.BenchmarkConsole"/>
9999
</Target>
100100
<SearchPaths>
101101
<IncludeFiles Value="$(ProjOutDir)"/>

HashLib.Benchmark/Lazarus/PerformanceBenchmarkConsole.lpr renamed to HashLib.Benchmark/Lazarus/HashLib.BenchmarkConsole.lpr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
program PerformanceBenchmarkConsole;
1+
program HashLib.BenchmarkConsole;
22

33
{$MODE DELPHI}
44

55
uses
66
SysUtils,
7-
uPerformanceBenchmark;
7+
PerformanceBenchmark;
88

99
procedure ConsoleLog(const AMessage: String);
1010
begin

HashLib.Benchmark/src/Core/uBenchmarkCommon.pas renamed to HashLib.Benchmark/src/Core/BenchmarkCommon.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit uBenchmarkCommon;
1+
unit BenchmarkCommon;
22

33
{$IFDEF FPC}
44
{$MODE DELPHI}

HashLib.Benchmark/src/Core/uHashPerformanceBenchmark.pas renamed to HashLib.Benchmark/src/Core/HashPerformanceBenchmark.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit uHashPerformanceBenchmark;
1+
unit HashPerformanceBenchmark;
22

33
{$IFDEF FPC}
44
{$MODE DELPHI}
@@ -13,7 +13,7 @@ interface
1313
HlpIHash,
1414
HlpHashFactory,
1515
HlpCRC,
16-
uBenchmarkCommon;
16+
BenchmarkCommon;
1717

1818
type
1919
THashPerformanceBenchmark = class sealed(TObject)

HashLib.Benchmark/src/Core/uKdfPerformanceBenchmark.pas renamed to HashLib.Benchmark/src/Core/KdfPerformanceBenchmark.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit uKdfPerformanceBenchmark;
1+
unit KdfPerformanceBenchmark;
22

33
{$IFDEF FPC}
44
{$MODE DELPHI}
@@ -8,7 +8,7 @@
88
interface
99

1010
uses
11-
uBenchmarkCommon,
11+
BenchmarkCommon,
1212
HlpIKDF;
1313

1414
type

HashLib.Benchmark/src/Core/uPerformanceBenchmark.pas renamed to HashLib.Benchmark/src/Core/PerformanceBenchmark.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit uPerformanceBenchmark;
1+
unit PerformanceBenchmark;
22

33
{$IFDEF FPC}
44
{$MODE DELPHI}
@@ -8,9 +8,7 @@
88
interface
99

1010
uses
11-
uBenchmarkCommon,
12-
uHashPerformanceBenchmark,
13-
uKdfPerformanceBenchmark;
11+
BenchmarkCommon;
1412

1513
type
1614
TPerformanceBenchmark = class sealed(TObject)
@@ -23,7 +21,9 @@ TPerformanceBenchmark = class sealed(TObject)
2321
implementation
2422

2523
uses
26-
Math;
24+
Math,
25+
HashPerformanceBenchmark,
26+
KdfPerformanceBenchmark;
2727

2828
class procedure TPerformanceBenchmark.Run(ALogProc: TBenchmarkLogProc;
2929
const ABufferSizes: array of Int32);

0 commit comments

Comments
 (0)