Perl6 is pretty new, any sort of performance data is good.


On 7/22/2017 7:53 AM, Shlomi Fish wrote:
Hi all!

Some time ago I solved this problem - https://projecteuler.net/problem=343 -
using a relatively slow pypy3 program (see
https://github.com/shlomif/project-euler/blob/master/project-euler/343/euler_343_v1.py
). After gaining access to the problem's forum, I found a faster way to solve
it in PARI/GP there -
https://github.com/shlomif/project-euler/blob/master/project-euler/343/euler_343_v2.gp
and translated it into perl 5 + bash -
https://github.com/shlomif/project-euler/blob/master/project-euler/343/euler_343_v2.bash
 .
It uses https://en.wikipedia.org/wiki/Factor_(Unix) which is written in
optimised C.

Now, after I translated the program to Pure Perl 6 -
https://github.com/shlomif/perl6-examples/blob/shlomif--euler343/categories/euler/prob343-shlomif.p6
 ,
the perl 6 version ran very slowly. I bugged the people on freenode about it
until someone there translated the shell version to use perl 6 instead of p5,
and said it performed roughly as well. This gave me an idea to try an
equivalent perl 5 version - see
https://github.com/shlomif/project-euler/blob/master/project-euler/343/prob343-shlomif.pl
and it ran at a comparable, slow, speed as the perl 6 version.

So to sum up:

1. GNU factor is really fast.

2. When it comes to factorisation, perl 5 and perl 6 are slower and run at a
comparable speed.

I apologise for the noise I caused.

Regards,

        Shlomi

Reply via email to