Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Perl 5 Optimizing Compiler, Part 7: Video Chat w/ Ingy & Reini, Today 9/18 8pm Central Time

by chromatic (Archbishop)
on Sep 18, 2012 at 07:39 UTC ( #994225=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Perl 5 Optimizing Compiler, Part 7: Video Chat w/ Ingy & Reini, Today 9/18 8pm Central Time
in thread Perl 5 Optimizing Compiler, Part 7: Video Chat w/ Ingy & Reini, Today 9/18 8pm Central Time

Why are people so intent on keeping Perl5 stuck in its rut?

Sounds like a false dilemma to me!

I'd like a faster Perl 5, but given my experience trying to get a performant Perl 6 and Parrot, I think I have some practical thoughts on what makes a Perl implementation fast or slow and how to get there from here.

If you want to get more than 5% here or 10% there, you have to address the difficult problem, namely that the current Perl 5 implementation optimizes for dynamicity, whereas in the real world, code that's already into its runtime is 90% static. Perl 5's polymorphism is in the wrong place because it was too expensive in 1993 to put it in the right place.


Comment on Re^4: Perl 5 Optimizing Compiler, Part 7: Video Chat w/ Ingy & Reini, Today 9/18 8pm Central Time
Re^5: Perl 5 Optimizing Compiler, Part 7: Video Chat w/ Ingy & Reini, Today 9/18 8pm Central Time
by Will_the_Chill (Pilgrim) on Sep 18, 2012 at 07:43 UTC
    chromatic,

    Can you please elaborate on the proper & improper places for Perl5's polymorphisms?

    Thanks,
    ~ Will

      For example, every Perl 5 op has to check if its operands are tied or have other magic attached. That's at least one if clause in every op (but I repeat myself).

      Compiling Perl 5 with clang won't help that at all because the types of the operands aren't known until you run a Perl 5 program.

      If, instead, the internals had separate types of variables depending on the attached magic such that the code to get a value from a tied scalar were a part of the tied scalar and not in every op, a lot of code could go away. A lot of conditionals could go away, especially for the common case where most scalars aren't tied scalars.

      (Doing that in C like Parrot does doesn't really help much, because even a good optimizing C compiler can't optimize the trailer park polymorphic dispatch you have to write by hand to get something remotely like an object system in C. Chip had the right idea with Topaz, except that cross-platform C++ was awfully hard to support then.)

      You can speed up op dispatch all you want, but the slow part of Perl 5 is the part that manages data.

Re^5: Perl 5 Optimizing Compiler, Part 7: Video Chat w/ Ingy & Reini, Today 9/18 8pm Central Time
by BrowserUk (Pope) on Sep 18, 2012 at 09:00 UTC
    Sounds like a false dilemma to me!

    You hear what you want to hear.

    There is nothing false about:

    • Hey. We're investigating X; come and join in if you are interested.
    • It's a waste of time; it can't be done; you shouldn't even try; it's anti-Perl; anti-Larry; anti-FOSS; anti-us -- and tantamount to genocide to even try.
    I'd like a faster Perl 5, but given my experience ... naysay, naysay... If you want to get more than 5% here or 10% there, naysay, naysay ...

    Is just more of the same.

    Have you ever profiled to see where Perl spends most of its time? I have. In order: stack manipulation; memory allocation; testing for the presence of magic; doing actual work.

    Have you ever measured how many clock cycles it takes Perl5 to allocate 2 new scalars, push them onto its stack(s) and transfer control to code that pulls them off manipulates them, produces an answer, allocated space for it, pushes it onto the stacks and return control to the "caller"?

    Have you ever contrasted that with doing the identical steps using the C-stack. Still dynamically; full SV-style manipulations; no compile-time optimisations. Just switching the C stack for Perl's 4 heap stacks?

    I have. And there is a crap load of room for a performance hike. Conservatively 200% looks doable without changing Perl's syntax or semantics. Maybe much more.

    But there is no point in trying to discuss it; because the naysayers have already decided the outcome of all possible investigations and strategies. Or so they seem intent on us believing.

    My question -- my false dilemma as you prejudge it so off-handly -- is why? Why do they want us to believe it? What harm is it to them, if someone else chooses to try?


    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".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      It's a waste of time; it can't be done; you shouldn't even try; it's anti-Perl; anti-Larry; anti-FOSS; anti-us -- and tantamount to genocide to even try.

      You forgot the Trilateral Commission, Project Majestic, Holocaust denial, and the Bavarian Illuminati. Bonus points for an Erich von Daniken reference connected to the Zapruder film by way of birthers and 9/11 was an inside job Ron Paul supporters, because clearly the only two possible choices are "do it the BuK way!" or "let Perl 5 die a slow, stagnant death".

      Have you ever profiled to see where Perl spends most of its time?

      Yes.

      Have you ever implemented a dynamic language like Perl?

      But there is no point in trying to discuss it; because the naysayers have already decided the outcome of all possible investigations and strategies.

      You ask an expert for an opinion, you get an expert's opinion. If you want to build a project on the opinion of uneducated amateurs, I suppose there's a chance you'll succeed.

      Conservatively 200% looks doable without changing Perl's syntax or semantics.

      I will believe that when I see it.

        You ask an expert for an opinion,

        Nobody asked anyone's opinion in this thread. That didn't stop many self-proclaimed experts popping up to regurgitate their mostly second-hand expertise.

        If you want to build a project on the opinion of uneducated amateurs,

        Who are you calling uneducated? Who are you calling an amateur?

        I suppose there's a chance you'll succeed.

        Hedging your bets already.

        Have you ever implemented a dynamic language like Perl?

        Yes. I wrote my first basic interpreter in in 1972/73 -- were you born then? Or still in your diapers?. The first version ran like a dog; the second was a vast improvement.

        And circa. 1987, a friend and I wrote a Small C interpreter. And used it to build an extended DOS shell -- also an interpreter.

        I will believe that when I see it.

        But if we followed your proscriptions, nobody would try and you would never see it.


        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".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-10-01 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (29 votes), past polls