1. Just in case [wow... comment added _tom]

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:

https://rosettacode.org/wiki/Palindromic_gapful_numbers#Ludicrously_fast_to_10.2C000.2C000.2C000.2C000.2C000.2C000th

So, Pete, what have you been up to during lockdown...

EDIT: the limit has been increased by 10,000 - link fixed

new topic     » topic index » view message » categorize

2. Re: Just in case

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Just in case

... 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)

new topic     » goto parent     » topic index » view message » categorize

4. Re: Just in case

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: Just in case

_tom said...
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.)

new topic     » goto parent     » topic index » view message » categorize

6. Re: Just in case

_tom said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu