challenge Offical launch of the 1 Billion Row Challenge in Object Pascal

Recommended Posts

Posted (edited)

This is a "classical" problem with Delphi, overloaded functions, and floating points values.

IMHO using currency is an awful workaround here, and should not be kept in any serious codebase.
It works "by chance".

Another workaround, still using the Math unit, is to make the computation in two steps:

function RoundExDouble(x: double): Double;
begin
x := x * 10;
Result := Ceil(x) / 10;
end;

function RoundExInteger(x: double): Integer;
begin
x := x * 10;
Result := Ceil(x);
end;

So the expected Ceil(double) overload is clearly picked up by the compiler.

Or define our own unique Ceil() function, which does not depend on Math.pas and ensure we use the right value type:

function ceil(x: double): integer;
begin
result := trunc(x) + ord(frac(x) > 0);
end;

This is this solution I used in my entry of the challenge: stay away from Math.pas. 😉

Edited by Arnaud Bouchez
• 1

On 3/12/2024 at 6:46 AM, Gustavo 'Gus' Carreno said:

Hey Cornelius,

I was actually considering this one: VSoft.CommandLineParser

That one seems to be a self contained thing without dragging much more.

But also had these in the back burner:

But now I need to add that one to my list since I don't have it 😃

Thanks !!

Cheers,

Gus

Nice list, thanks 👍

You missed these few, probably:

• 2

Hey Rollo62.

Thank you sooooo very much for extending my list!!!

Cheers,

Gus

Hey my challenge peeps!!

I've been busy:

• The automation is now done for both Linux and Windows
• We are back to the previous output hash: 4256d19d3e134d79cc6f160d428a1d859ce961167bd01ca528daca8705163910
• I've altered all the entries that were using an internal version of the rounding functions to use the one from the baseline

Today is Saturday, and now that I have the automation completed, I'll run the full shebang and will update the results table once they are done.

Cheers,

Gus

On 3/29/2024 at 11:37 AM, Rollo62 said:

Nice list, thanks 👍

And don't forget the command line parser available in mORMot 2.

- Works on all OS;

- Works on Delphi and FPC;

- Can auto-generate the help content with proper formatting;

- Minimal code writing.

In practice, resulting code is short and efficient:

• 1

Posted (edited)

Hey my challenge peeps!!

The weekly Saturday results are up.
Get'em while they're hot 😉

Cheers,

Gus

Edited by Gustavo 'Gus' Carreno

My dear challenge peeps!!

• Ian Barker has written an article that mentions our little challenge.

I would provide a link to this new edition if I could. Their site is a bit sub-par, to put it quite politely.

Cheers,
Gus

Hey my challenge peeps!!

We have new entries.
We have have a new leader.

Weekly Results have been updated.

Cheers,
Gus

Hey my challenge peeps!!

Yeah, I know, owner... Still don't understand why, but it's where we're at, LOL!! 😄
Now I'm in a bit of a pickle: I don't have an icon that will represent Object Pascal.
There's many for Delphi, and many for Lazarus, but none for Object Pascal in general.
Can anyone help me on this?

Cheers,

Gus

Hey my challenge peeps!!

I've put up the GitHub repository for all the Object Pascal logo proposals: https://github.com/gcarreno/UnofficialObjectPascalLogos
Any changes and new proposals will now be accepted via a PR.

Cheers,

Gus

Posted (edited)

Hey my challenge peeps!!

I've been thinking about adding an alternative results table in order to compare to the original Java specs of only 400 stations and 8 threads.
This means that some of the assumptions for the current state of things would probably be crippling in that case.
What do you guys think of adding a -4 or --400-stations command line switch to your entries?

Cheers,

Gus

Edited by Gustavo 'Gus' Carreno

Hey my challenge peeps!!

We are moving from the input file having CRLF to having only LF as the line terminator.
Next run, the 27th of April, will be mixed to leave enough time for everyone to make the necessary changes.
The next run after that, the 4th of May, will not be mixed and will expect every entry to have made changes if necessary.
The SHA256 for said input file has already been updated on the README.md file.

Cheers,

Gus

Two last weeks of the challenge...

Still time to post your own entry!

• 1

Hey my challenge peeps!!

Georges suggested that we may give a helping hand to the entries that haven't yet done the change from CRLF to LF only.
If any of you want to have a stab at it, it would be greatly appreciated!!
And, does anyone know how to contact Lurendrejer Aksen? His entry has been kinda abandoned and I would like to see it working properly, if possible.
Many thanks to my wonderful participants in advance!!

Cheers,

Gus

Posted (edited)
26 minutes ago, Gustavo 'Gus' Carreno said:

the entries that haven't yet done the change from CRLF to LF only.

No need for any changes to my entry--TStreamReader handles both already. And yes, I tested it.

Edited by corneliusdavid
• 1

Hey David,

1 minute ago, corneliusdavid said:

No need﻿ for any changes to my entry--TStreamReader handles﻿ both already. And yes, I tested it.

Awesome sauce !!
Thanks !!

Cheers,

Gus

Hey my challenge peeps!!

We are quickly approaching the deadline for our little challenge.
While the end date is next Friday, I will post the last results after I run the automation on Sat. of Sun.
You can still drop PRs after Friday, but they will only be merged after the automation is done on Sat. or Sun.

My intention with this repository is to keep accepting entries for the duration of my life time.
This is the perfect round up of Object Pascal code to demonstrate that it's not dead and can compete with any of the top languages on SO or TIOBE.

I'm also thinking about adding the 8 thread/400 Stations table for comparison with the Java side of things.
But I guess that Paweld has made a better attempt here.
More news on this table later.

Cheers,

Gus

Hey my challenge peeps!!

Looks like we have the results of the comparison back and Object Pascal is quicker than Java.

Cheers,

Gus

• 1

Hey my challenge peeps!!

The end has past.
Things are ready for the last automation run.
I'll post the results first thing after I've had a sleep.
During that sleep, the automation will run.

Cheers,

Gus

Hey my challenge peeps!!

We have finally arrived at the end of the challenge!!
It's been a fun ride, to say the least.
The final results have been posted, with the usual minor ooopss, of course.

Like stated before, I'll be accepting entries until I'm no longer in this plane of existence.
A new results table for those entries will be made, and it will include all of the entries, old and new.

Eventually, I'll also publish a results table for 400 Stations and 8 threads.
Just need a bit of breathing space to get that done. But it will come.

Let's hope this repository, and the effort of the participants, can stand as an example of the power that still resides in Object Pascal.
Let's hope we can all shut up the nay sayers by merely pointing at it.

All the best for you all in your future Object Pascal endeavours!!

Cheers,

Gus

• 2
• 1

Create an account

Register a new account

×