|The stupid question is the question not asked|
Re^4: Reasons for Using "Perl6" (don't need to earn a living?)by Laurent_R (Canon)
|on Dec 23, 2017 at 11:24 UTC||Need Help??|
Yes, Perl 6 is generally slower than Perl 5, this has not been denied by any one. But very significant improvements have been made and more are to come.
Two orders of magnitude? This is a factor of 100. So you're saying that Perl 6 is at least 100 times slower. Let's see.
This is a very simple benchmark on a loop:
So here, the first Perl 6 test took 21 seconds, which is a bit more than 5 times slower than Perl 5. That's not anywhere near two orders of magnitude. Just adding the int hint (no pun intended) for the compiler to optimize its handling of the integer variable led to 9 seconds, so that, in the last test, Perl 6 is about 2.25 slower than Perl 5. I wish it were not so, but that's where we stand. There is definitely room for improvement. A year ago, or so, it might have been slower by a factor of 10. What will it be in a year from now? I really don't know, but performance improvements are being made almost every single week, so it is likely to improve significantly.
And, BTW, I know the results are low resolution, but that's not a Perl 6 limitation: Perl 6 has a built-in now function giving a much higher resolution:
For some other computations, Perl 6 will slower than Perl 5 by a significantly higher margin, perhaps 10 to 20 times, but, again, it is improving all the time.
Also, look at the Perl 5 and Perl 6 pieces of code: can anyone say that these languages are not closely related?