http://www.perlmonks.org?node_id=990795


in reply to Re^2: Perl 5 Optimizing Compiler, Part 5: A Vague Outline Emerges
in thread Perl 5 Optimizing Compiler, Part 5: A Vague Outline Emerges

I understand that strategy, and it's probably easier to start to see results than most other approaches, but keep in mind a few drawbacks:

I expect the resulting binaries to be huge. I expect the link and optimization steps to take a long time. I expect you'll have to keep the Perl 5 interpreter around anyway because there are things you just can't do without either rewriting the language (to get around the BEGIN/import symbol declaration dance, for example. I don't know if you have to include any LLVM runtime components.

I can imagine that you can optimize some programs with this approach, but I don't know that the intrinsic overhead in the Perl 5 VM you get is more than 10%. Maybe link-time optimization can cut out another 10%. Part of that is the inherent flexibility of Perl 5's design, and part of that is that LLVM is at heart a really good compiler for languages that act like C++.

Replies are listed 'Best First'.
Re^4: Perl 5 Optimizing Compiler, Part 5: A Vague Outline Emerges
by BrowserUk (Patriarch) on Aug 30, 2012 at 17:32 UTC

    I'm not sure there is a direct question in there for me to respond to, so all I'll say is that it is a minimal up-front effort strategy that puts the hooks in place that would allow some real measurements to be taken.

    And even that minimal effort needn't be discarded if the LLVM experiments fail, because it leaves an intact perl distribution that works just as efficiently and effectively as it does now, with the only difference being that the compiled perl executable comes in 3 parts rather than the current two. (In windows terms: perl.exe dynalinked to perl5.x.part1&2.dll & perl5.x.part3.dll)

    And that split might even benefit the normal distribution in some way.

    Once the hooks were in there, the ability to pass the PCG to some other dll, module or process, might allow other investigations to move forward.


    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

    /code

      If this approach could lead to a cleaner separation of the parser from the runtime, that might be a worthwhile thing in and of itself, apart from any LLVM success or failure. It's worth considering further.