Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Perl 6 and performance

by Anonymous Monk
on Feb 26, 2016 at 19:59 UTC ( [id://1156267]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl 6 and performance
in thread Perl 6 and performance

And here's an update comparing "Christmas Perl6", aka v6.c, aka rakudo star 2016.01.1 to Strawberry Perl 5.16.3, using a bat script on Windows 7:
echo %time% - perl5 call c:\strawberry_perl\portableshell.bat -E "my $s; for ( 1..1000000 +) { $s+=1/$_**2 }; say $s" echo !time! echo %time% - perl6 call perl6 -e "my $s; for ( 1..1000000 ) { $s+=1/$_**2 }; say $s" echo %time%
Note I'm using a million iterations to make the times more accurate to compare. The output was:
14:03:07.14 - perl5 1.64493306684877 14:03:07.64 14:03:07.65 - perl6 1.64493306684877 14:03:19.05
So, perl5 took .5 sec and perl6 took 11.4 secs, making perl6 almost 23 times slower than perl5. I really hope this is improved on in subsequent releases of perl6. John

Replies are listed 'Best First'.
Re^3: Perl 6 and performance
by BrowserUk (Patriarch) on Feb 27, 2016 at 02:59 UTC
    So, perl5 took .5 sec and perl6 took 11.4 secs, making perl6 almost 23 times slower than perl5. I really hope this is improved on in subsequent releases of perl6. John

    My considered assessment is that in order to be able to support the needs of MOP, and installable parsers, the levels of indirection required within the opcode tree are such that Perl6 will never be able to achieve the performance of Perl5; much less (uncompiled) Java and similar.

    From my brief appraisals of the performance it currently achieves, and an even more brief exploration of the source code, I think it quite unlikely that the Perl6 syntax will ever be able to get within an order of magnitude of Perl5 performance as a purely interpreted language. I think it would require a full optimising compiler to achieve any real breakthrough in its performance.

    It is possible that a JIT compiler could fold out some of the indirections, but I suspect that it would require serious machine level skills on each targeted platform for that to be achieved.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Perl 6 and performance
by coke (Acolyte) on Feb 29, 2016 at 17:41 UTC
    A few things to note:

    In Perl 6, that math is going to default to Rationals, meaning you're keeping around a numerator and denominator and doing a bit more math than you might otherwise be expecting than p5's floats.

    The point of the Christmas release was to stabilize the spec. Work in the upcoming year on Rakudo Perl 6 is going to target optimizations in both JIT and code generation.

Re^3: Perl 6 and performance
by Your Mother (Archbishop) on Feb 26, 2016 at 20:21 UTC

    While I don’t find this kind of benchmark too exciting I will add that the difference is greater on OS X; well over a hundred times faster for 5. It’s easy, for me anyway, to forget how well tuned 5 is…

    # This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin- +2level moo@cow[22]~>time perl -E 'my $s; for ( 1..1_000_000 ) { $s+=1/$_**2 } +; say $s' 1.64493306684877 0.111u 0.000s 0:00.11 100.0% 0+0k 0+2io 0pf+0w # Both the last two Rakudo builds of 6.c produced same results moo@cow[30]~>time perl6 -e 'my $s; for ( 1..1_000_000 ) { $s+=1/$_**2 +}; say $s' 1.64493306684877 16.198u 0.300s 0:16.55 99.6% 0+0k 0+0io 0pf+0w

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1156267]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found