1. Just in case [wow... comment added _tom]
- Posted by petelomax Dec 11, 2020
- 1128 views
- Last edited Jan 15, 2021
If you, like so many others, have ever wondered how can you possibly find the 10,000,000,000,000,000,000th Palindromic gapful number, fret no more:
So, Pete, what have you been up to during lockdown...
EDIT: the limit has been increased by 10,000 - link fixed
2. Re: Just in case
- Posted by petelomax Jan 15, 2021
- 926 views
Bump.
I found an article comparing the Rust and Crystal programming languages that manages to optimise things and get 10^7 in 6s, which doesn't really compare to 10^19 in 0.8s...
Of course I'll happily answer any questions about how it works, and/or help write an article about it.
3. Re: Just in case
- Posted by petelomax Jan 15, 2021
- 862 views
... and I've just replaced the rmdr() function of that with a much simpler version.
(not that it improves any on the 0.8s, you understand)
4. Re: Just in case
- Posted by _tom (admin) Jan 15, 2021
- 822 views
I edited your title. Could not resist.
I installed crystal, and rust. (Not great fun compared to a Phix install)
Results, by timing system_exec() for each case.
Time in seconds | |
---|---|
Phix (first example) | 0.04 |
Phix (second example) | 1.2 |
crystal | 90 |
rust | 212 |
python | did not finish |
Let's create a description of these results (after re-testing). Then, a volunteer (other than me or Pete) could try putting this up at OSNews.
be well
_tom
5. Re: Just in case
- Posted by petelomax Jan 15, 2021
- 815 views
- Last edited Jan 16, 2021
Time in seconds | |
---|---|
Phix (first example) | 0.04 |
Phix (second example) | 1.2 |
crystal | 90 |
rust | 212 |
Careful, as posted my first example only runs to a mere 1,000.
It takes 6.5s to get to 100,000.
It needs 64-bit and takes 15.8s to get to 1,000,000.
It needs 64-bit and 3mins 6s (186s) to get to 10,000,000, which is the compare-able thingy [yes?].
By-the-by, a translation of the Crystal code [original rc, not the rust.lang page] to Phix took 17.5s to get to 100,000, vs my original's 6.5s, so I didn't pursue that any further.
Half or even one third the speed of Crystal, I can live with, faster than Rust, even slightly, I'm surprised. But there's really no like-for-like story worth telling here,
it is more just a bit of fun about a fancy algo smashing records. (The 1.2s sounds about right for all the way to 10^19 on a machine a bit slower than mine.)
6. Re: Just in case
- Posted by katsmeow Jan 16, 2021
- 808 views
I installed crystal, and rust. (Not great fun compared to a Phix install)
Results, by timing system_exec() for each case.
Wait a sec, i thought this was forbidden, to make such comparisons to other languages?
Kat