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:

C:\Users\Laurent>perl -E "my $c = 1; my $start = time; while (1) { $c+ ++; last if (2 * $c ) > 50000000 ; }; say time - $start; say $c" 4 25000001 C:\Users\Laurent>perl6 -e "my $c = 1; my $start = time; while (1) { $c +++; last if (2 * $c ) > 50000000 ; }; say time - $start; say $c" 21 25000001 C:\Users\Laurent>perl6 -e "my int $c = 1; my $start = time; while (1) +{ $c++; last if (2 * $c ) > 50000000 ; }; say time - $start; say $c" 9 25000001
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:

C:\Users\Laurent>perl6 -e "my int $c = 1; my $start = now; while (1) { + $c++; last if (2 * $c ) > 50000000 ; }; say now - $start; say $c" 8.9252329 25000001
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?


In reply to Re^4: Reasons for Using "Perl6" (don't need to earn a living?) by Laurent_R
in thread Reasons for Using Perl 6 by aartist

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.