Skip to content

Commit 95f0f82

Browse files
authored
Merge branch 'gcarreno:main' into main
2 parents 2ac2840 + e5581e8 commit 95f0f82

File tree

22 files changed

+1611
-71
lines changed

22 files changed

+1611
-71
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
/profiling
55
/results
66
/entries/entries.json
7-
compile_all.*
8-
test_all.*
9-
run_all.*
7+
*_all.*
108

119
# Compiled l10n files: .mo should be ignored
1210
*.mo

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Formatting
55

6-
All entries should be formatted using the `Ctr-D` shortcut for both Lazarus and Delphi entries.
6+
All source code should be formatted using the default formatting rules for Pascal code, which your IDE should provide. Both Lazarus and Delphi uses `Ctr-D` as a shortcut to format your code.
77

88
## Folder name for the entry
99

@@ -13,11 +13,11 @@ For example, using _Gustavo Carreno_ for the name, the folder would be `entries/
1313

1414
## Name of the executable binary
1515

16-
The executable binary follows the same rules has the entry folder above.
16+
The executable binary follows the same rules has the entry folder above; therefore, on Windows, the above example's executable would be `gcarreno.exe` and on Linux, just `gcarreno`.
1717

1818
## Placement of the executable binary
1919

20-
The executable binary should be placed under a folder named `bin` below the root folder of this repository.
20+
The executable binary should be placed under a folder named `bin` below the root folder of this repository (`../../../bin` relative to your source).
2121

2222
This folder is not present on the repository and is being ignored from the `.gitignore`.
2323

@@ -57,7 +57,8 @@ The type is contained within the title and can be one of these types:
5757
Subjects should be no greater than 50 characters, should begin with a capital letter and do not end with a period.
5858

5959
Use an imperative tone to describe what a commit does, rather than what it did. For example, use change; not changed or changes.
60-
The Body
60+
61+
### The Body
6162

6263
Not all commits are complex enough to warrant a body, therefore it is optional and only used when a commit requires a bit of explanation and context. Use the body to explain the what and why of a commit, not the how.
6364

README.md

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,37 @@ The task is to write an Object Pascal program which reads the file, calculates t
3636
```
3737

3838
## Entering The Challenge
39-
Submissions will be via a `PR`( Pull Request ) to this repository. \
39+
Submissions will be via a `PR` (Pull Request) to this repository.
4040
The challenge will run from the 10th of March until the 10th of May, 2024.
4141

4242
When creating your entry, please do as follows:
4343
1. Create a folder under `entries` with your first initial and last name, e.g., for Gustavo Carreno: `entries/gcarreno`.
4444
2. If you're worried about anonymity, because the Internet stinks, feel free to use a fictional one: Bruce Wayne, Clark Kent, James Logan, Peter Parker, Diana of Themyscira. Your pick!
4545
3. Create a `README.md` with some content about your approach, e.g., `entries/gcarreno/README.md`.
4646
4. Put all your code under `entries/<your name>/src`, e.g., `entries/gcarreno/src`.
47-
5. If you need to provide a custom `.gitignore` for something not present in the main one, please do.
47+
5. Send your binary to the `bin` folder off the root of this repository.
48+
6. If you need to provide a custom `.gitignore` for something not present in the main one, please do.
49+
7. Read the [CONTRIBUTING.md](./CONTRIBUTING.md) file for more details.
4850

4951
This challenge is mainly to allow us to learn something new. This means that copying code from others will be allowed, under these conditions:
5052
1. You can only use pure Object Pascal with no calls to any operating system's `API` or external `C/C++` libraries. \
51-
**There's been a bit of confusion about this restriction.** \
52-
To clear that out: You can use any package/custom code you want. \
53-
As long as it compiles cross-platform and itself is only pure Object Pascal. \
54-
Anything from the `Jedi Project` or even `mORMmot` ( or anything else ), if it compiles, runs cross-platform it's allowed.
53+
**There's been a bit of confusion about this restriction.**
54+
- To clear that out: You can use any package/custom code you want.
55+
- As long as it compiles cross-platform and itself is only pure Object Pascal.
56+
- Anything from the `Jedi Project` or even `mORMmot` ( or anything else ), if it compiles, runs cross-platform it's allowed.
5557
2. The code must have some sort of mention/attribution to the original author, in case you've used someone else's code.
5658
3. It's not a blatant copy just for the sake of submission.
5759
4. It adds something of value, not just a different code formatting.
5860
5. All code should be formatted with the `IDE`'s default formatting tool.
5961

60-
**IMPORTANT** \
61-
This challenge can be entered even if you only have access to the Community Edition of RAD Studio. \
62-
I have a Windows VM, with RAD Studio installed, that will do the necessary cross compilation into my Linux host.
62+
**IMPORTANT**
63+
This challenge can be entered even if you only have access to the Community Edition of RAD Studio. I have a Windows VM, with RAD Studio installed, that will do the necessary cross compilation into my Linux host.
6364

6465
Submit your implementation and become part of the leader board!
6566

6667
## Rounding
6768

68-
Székely Balázs has provided code for rounding towards positive infinity per the original challenge.\
69+
Székely Balázs has provided code for rounding towards positive infinity per the original challenge.
6970
This will be the official way to round the output values:
7071
```pas
7172
function TBaseline.RoundEx(x: Double): Double;
@@ -96,7 +97,7 @@ end;
9697
```
9798

9899
## Generating the measurements.txt
99-
> **NOTE** \
100+
> **NOTE**
100101
> We now have both a Lazarus version and a Delphi version of the generator for both 32b and 64b.
101102
102103
In order to produce the One Billion Rows of text, we are providing the [source code](./generator) for the official generator, so we all have the same entry data.
@@ -110,7 +111,7 @@ In order to produce the One Billion Rows of text, we are providing the [source c
110111
| **-n** or **--line-count \<number\>** | The amount of lines to be generated ( Can use 1_000_000_000 ) |
111112

112113
## Baseline
113-
> **NOTE** \
114+
> **NOTE**
114115
> This is still a bit in flux, still needing to get the Delphi version done.
115116
116117
In order to verify the official output, we are providing the [source code](./baseline) for the official baseline.
@@ -147,6 +148,21 @@ Expected `SHA256` hash:
147148
> Until then, this is the current one: `db3d79d31b50daa8c03a1e4f2025029cb137f9971aa04129d8bca004795ae524`
148149
> There's also an archived version of the [baseline output](./data/baseline.output.gz)
149150
151+
## Differences From Original
152+
I've decided that I would want this challenge to be turned way up to 11!
153+
154+
This means that there are some differences from the original.
155+
156+
The original results are calculated on a smaller set of weather stations: 400.\
157+
While I haven't tabulated how many reside on the input file, we do not limit it to any number as we use the full ~40K stations present on `data/weather_stations.csv` to generate the input file.
158+
159+
Another difference is the machines these are run on.\
160+
I'm using my own machine, with the specs mentioned on the [Results](#results) section bellow.\
161+
I'm also allowing the use of the full 32 threads that my machine provides, where the original challenge limits it to 8.\
162+
The original challenge also has a second results table with 10K stations and the use of all 64 threads.
163+
164+
With all this said, comparison with the original challenge should be made with this in mind.
165+
150166
## Results
151167
These are the results from running all entries into the challenge on my personal computer:
152168
- Ubuntu 23.10 64b
@@ -155,10 +171,18 @@ These are the results from running all entries into the challenge on my personal
155171
- 250GB SSD
156172
- 1TB HDD
157173

158-
| # | Result (m:s.ms): SSD | Result (m:s.ms): HDD | Compiler | Submitter | Notes | Certificates |
159-
|--:|---------------------:|---------------------:|:---------|:--------------|:----------|:-------------|
160-
| 1 | 0:29.212 | 2:2.504 | lazarus-3.0, fpc-3.2.2 | Székely Balázs | Using 16 threads | |
161-
| 2 | 15:3.075 | 15:7.630 | lazarus-3.0, fpc-3.2.2 | Iwan Kelaiah | Using 1 thread | |
174+
| # | Result (m:s.ms) | Compiler | Submitter | Notes | Certificates |
175+
|--:|----------------:|---------:|:----------|:------|:-------------|
176+
| 1 | 0:2.472 | lazarus-3.0, fpc-3.2.2 | Arnaud Bouchez | Using 16 threads | |
177+
| 2 | 0:16.874 | lazarus-3.0, fpc-3.2.2 | Székely Balázs | Using 16 threads | |
178+
| 3 | 0:20.046 | lazarus-3.0, fpc-3.2.2 | Lurendrejer Aksen | using 30 thread | |
179+
| 4 | 1:16.059 | lazarus-3.0, fpc-3.2.2 | Richard Lawson | Using 1 thread | |
180+
| 5 | 12:40.179 | lazarus-3.0, fpc-3.2.2 | Iwan Kelaiah | Using 1 thread | |
181+
182+
> **NOTE**
183+
>
184+
> After some tests performed by @paweld, it makes no sense to have an `HDD` run.
185+
> I've removed that from the results
162186
163187
## Evaluating Results
164188
Each contender is run 10 times in a row for both `SSD` and `HDD` using `hyperfine` for the time taking. \
@@ -183,7 +207,8 @@ A: Ubuntu 23.10 64b.
183207
I'd like to thank [@paweld](https://github.com/paweld) for taking us from my miserable 20m attempt, to a whopping ~25s, beating the [Python script](https://github.com/gunnarmorling/1brc/blob/main/src/main/python/create_measurements.py) by about 4 and a half minutes.\
184208
I'd like to thank [@mobius](https://github.com/mobius1qwe) for taking the time to provide the Delphi version of the generator.\
185209
I'd like to thank [@dtpfl](https://github.com/dtpfl) for his invaluable work on maintaining the `README.md` file up to date with everything.\
186-
I'd like to thank Székely Balázs for providing many patches to make everything compliant with the original challenge.
210+
I'd like to thank Székely Balázs for providing many patches to make everything compliant with the original challenge.\
211+
I'd like to thank [@corneliusdavid](https://github.com/corneliusdavid) for giving some of the information files a once over and making things more legible and clear.
187212

188213
## Links
189214
The original repository: https://github.com/gunnarmorling/1brc \

0 commit comments

Comments
 (0)