Skip to content

Commit 3016ee8

Browse files
author
Arnaud Bouchez
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 3c5b647 + dcc9dd2 commit 3016ee8

File tree

11 files changed

+441
-36
lines changed

11 files changed

+441
-36
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,13 @@ These are the results from running all entries into the challenge on my personal
172172

173173
| # | Result (m:s.ms): SSD | Result (m:s.ms): HDD | Compiler | Submitter | Notes | Certificates |
174174
|--:|---------------------:|---------------------:|:---------|:--------------|:----------|:-------------|
175-
| 1 | 0:29.212 | 2:2.504 | lazarus-3.0, fpc-3.2.2 | Székely Balázs | Using 16 threads | |
176-
| 2 | 15:3.075 | 15:7.630 | lazarus-3.0, fpc-3.2.2 | Iwan Kelaiah | Using 1 thread | |
175+
| 1 | 0:2.472 | \* | lazarus-3.0, fpc-3.2.2 | Arnaud Bouchez | Using 16 threads | |
176+
| 2 | 0:16.874 | 2:26.323 | lazarus-3.0, fpc-3.2.2 | Székely Balázs | Using 16 threads | |
177+
| 3 | 0:20.046 | \* | lazarus-3.0, fpc-3.2.2 | Lurendrejer Aksen | using 30 thread | |
178+
| 4 | 1:16.059 | 1:16.471 | lazarus-3.0, fpc-3.2.2 | Richard Lawson | Using 1 thread | |
179+
| 5 | 12:40.179 | 12:28.007 | lazarus-3.0, fpc-3.2.2 | Iwan Kelaiah | Using 1 thread | |
180+
181+
\* : Having issues with Linux watchdog killing the shell process
177182

178183
## Evaluating Results
179184
Each contender is run 10 times in a row for both `SSD` and `HDD` using `hyperfine` for the time taking. \

entries/abouchez/src/brcmormot.lpi

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
<MainUnitHasCreateFormStatements Value="False"/>
88
<MainUnitHasTitleStatement Value="False"/>
99
<MainUnitHasScaledStatement Value="False"/>
10+
<CompatibilityMode Value="True"/>
1011
</Flags>
1112
<SessionStorage Value="InProjectDir"/>
1213
<Title Value="brcmormot"/>
1314
<UseAppBundle Value="False"/>
1415
<ResourceType Value="res"/>
1516
</General>
16-
<BuildModes>
17-
<Item Name="Default" Default="True"/>
18-
<Item Name="Debug">
17+
<BuildModes Count="3">
18+
<Item1 Name="Default" Default="True"/>
19+
<Item2 Name="Debug">
1920
<CompilerOptions>
2021
<Version Value="11"/>
2122
<Target>
@@ -48,8 +49,8 @@
4849
</Debugging>
4950
</Linking>
5051
</CompilerOptions>
51-
</Item>
52-
<Item Name="Release">
52+
</Item2>
53+
<Item3 Name="Release">
5354
<CompilerOptions>
5455
<Version Value="11"/>
5556
<Target>
@@ -73,7 +74,7 @@
7374
<LinkSmart Value="True"/>
7475
</Linking>
7576
</CompilerOptions>
76-
</Item>
77+
</Item3>
7778
</BuildModes>
7879
<PublishOptions>
7980
<Version Value="2"/>
@@ -82,16 +83,16 @@
8283
<RunParams>
8384
<FormatVersion Value="2"/>
8485
</RunParams>
85-
<RequiredPackages>
86-
<Item>
86+
<RequiredPackages Count="1">
87+
<Item1>
8788
<PackageName Value="mormot2"/>
88-
</Item>
89+
</Item1>
8990
</RequiredPackages>
90-
<Units>
91-
<Unit>
91+
<Units Count="1">
92+
<Unit0>
9293
<Filename Value="brcmormot.lpr"/>
9394
<IsPartOfProject Value="True"/>
94-
</Unit>
95+
</Unit0>
9596
</Units>
9697
</ProjectOptions>
9798
<CompilerOptions>
@@ -120,16 +121,16 @@
120121
</Linking>
121122
</CompilerOptions>
122123
<Debugging>
123-
<Exceptions>
124-
<Item>
124+
<Exceptions Count="3">
125+
<Item1>
125126
<Name Value="EAbort"/>
126-
</Item>
127-
<Item>
127+
</Item1>
128+
<Item2>
128129
<Name Value="ECodetoolError"/>
129-
</Item>
130-
<Item>
130+
</Item2>
131+
<Item3>
131132
<Name Value="EFOpenError"/>
132-
</Item>
133+
</Item3>
133134
</Exceptions>
134135
</Debugging>
135136
</CONFIG>

utilities/script_builder/Common/scriptbuilder.data.config.pas renamed to utilities/common/utilities.data.config.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit ScriptBuilder.Data.Config;
1+
unit Utilities.Data.Config;
22

33
{$IFDEF FPC}
44
{$mode ObjFPC}{$H+}
@@ -13,7 +13,7 @@ interface
1313
, fpjson
1414
{$ELSE}
1515
{$ENDIF}
16-
, ScriptBuilder.Data.Entries
16+
, Utilities.Data.Entries
1717
;
1818

1919
type
@@ -28,7 +28,7 @@ interface
2828
{ ENodeStatusParamsWrongType }
2929
// ENodeStatusParamsWrongType = Exception;
3030

31-
{ TConfig }
31+
{ TConfig }
3232
TConfig = class(TObject)
3333
private
3434
FRootFolder: String;

utilities/script_builder/Common/scriptbuilder.data.entries.pas renamed to utilities/common/utilities.data.entries.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit ScriptBuilder.Data.Entries;
1+
unit Utilities.Data.Entries;
22

33
{$IFDEF FPC}
44
{$mode ObjFPC}{$H+}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
unit ResultsGenerator.Common;
2+
3+
{$IFDEF FPC}
4+
{$mode ObjFPC}{$H+}
5+
{$ENDIF}
6+
7+
interface
8+
9+
uses
10+
Classes
11+
, SysUtils
12+
, Utilities.Data.Config
13+
, Utilities.Data.Entries
14+
;
15+
16+
type
17+
{ TResults }
18+
TResults = class(TObject)
19+
private
20+
FConfig: TConfig;
21+
22+
function GenerateProgressBar(APBPosition, APBMax, APBWIdth: Integer): String;
23+
protected
24+
public
25+
constructor Create(AConfigFile: String);
26+
destructor Destroy; override;
27+
28+
{$IFDEF UNIX}
29+
{$ELSE}
30+
{$ENDIF}
31+
published
32+
end;
33+
34+
implementation
35+
36+
uses
37+
{$IFDEF FPC}
38+
fpjson
39+
, jsonparser
40+
{$ELSE}
41+
{$ENDIF}
42+
;
43+
44+
const
45+
lineBreak = #13;
46+
47+
{ TResults }
48+
49+
constructor TResults.Create(AConfigFile: String);
50+
var
51+
configStream: TFileStream;
52+
configJSONData: TJSONData;
53+
begin
54+
{ #todo 99 -ogcarreno : Config file must be used here }
55+
configStream:= TFileStream.Create(AConfigFile, fmOpenRead);
56+
try
57+
configJSONData:= GetJSON(configStream);
58+
FConfig:= TConfig.Create(configJSONData);
59+
configJSONData.Free;
60+
finally
61+
configStream.Free;
62+
end;
63+
end;
64+
65+
destructor TResults.Destroy;
66+
begin
67+
FConfig.Free;
68+
inherited Destroy;
69+
end;
70+
71+
function TResults.GenerateProgressBar(APBPosition, APBMax, APBWIdth: Integer
72+
): String;
73+
var
74+
percentDone: Double;
75+
filled: Integer;
76+
begin
77+
percentDone := 100 * (APBPosition / APBMax);
78+
filled := trunc(APBWIdth * (percentDone / 100));
79+
Result := '[';
80+
Result := Result + StringOfChar('#', filled);
81+
Result := Result + StringOfChar('-', APBWIdth - filled);
82+
Result := Result + Format('] %5.2f %%', [percentDone]);
83+
end;
84+
85+
end.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
unit ResultsGenerator.Console;
2+
3+
{$IFDEF FPC}
4+
{$mode ObjFPC}{$H+}
5+
{$ENDIF}
6+
7+
interface
8+
9+
uses
10+
Classes
11+
, SysUtils
12+
;
13+
14+
const
15+
cShortOptHelp: Char = 'h';
16+
cLongOptHelp = 'help';
17+
cShortOptVersion: Char = 'v';
18+
cLongOptVersion = 'version';
19+
cShortOptConfig: Char = 'c';
20+
cLongOptConfig = 'config-file';
21+
{$IFNDEF FPC}
22+
cShortOptions: array of char = ['h', 'v'{, 'i', 'o', 'n'}];
23+
cLongOptions: array of string = ['help', 'version'{, 'input-file', 'output-file',
24+
'line-count'}];
25+
{$ENDIF}
26+
27+
resourcestring
28+
rsAppTitle = 'One Billion Row Challenge Results Table Generator';
29+
rsScriptBuilderVersion = 'resultsgenerator v%s';
30+
rsErrorMessage = 'ERROR: %s';
31+
rsMissingConfigFlag = 'Missing config file flag.';
32+
rsConfigFile = 'Config Filename: "%s"';
33+
34+
var
35+
configFilename: String = '';
36+
37+
procedure WriteHelp;
38+
39+
40+
implementation
41+
42+
procedure WriteHelp;
43+
begin
44+
WriteLn('Generates a Markdown Table with the ordered results');
45+
WriteLn;
46+
WriteLn('USAGE');
47+
WriteLn(' resultsgenerator <flags>');
48+
WriteLn;
49+
WriteLn('FLAGS');
50+
WriteLn(' -h|--help Writes this help message and exits');
51+
WriteLn(' -v|--version Writes the version and exits');
52+
WriteLn(' -c|--config-file <filename> The file containing the configuration');
53+
end;
54+
55+
end.
56+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const
2+
cVersion = '0.1';

0 commit comments

Comments
 (0)