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


in reply to Re: Perl 5 Optimizing Compiler, Part 3: I Have A Dream
in thread Perl 5 Optimizing Compiler, Part 3: I Have A Dream

We can't ever have a requirement of other people needing to re-write their existing Perl 5 code to run with our stuff, it would be political death within the coding community. We need to be 100% backwards-sideways-forwards compatible with all Perl 5 code.

Exactly how to achieve that is what remains to be determined.
  • Comment on Re^2: Perl 5 Optimizing Compiler, Part 3: I Have A Dream

Replies are listed 'Best First'.
Re^3: Perl 5 Optimizing Compiler, Part 3: I Have A Dream
by bulk88 (Priest) on Aug 24, 2012 at 05:36 UTC
    Banning eval's visibility of lexicals is the number 1 way to optimize perl to C speed. You have to compile out the "english". Also banning magic would allow common subexpression elimination and convert SVs into more C like data/machine words. Reducing usage of the perl stack might be a worth idea to pursue. Considered taking a profiler to all the perl opcodes and see which are the slowest? I've modified NYTProf for myself to time per opcode times (part of NYTProf's CORE:: profiling system). There is a list in some header of NYTProf which says which opcodes to profile.

    A random idea I thought of today is, stop pp_sassign for target aware opcodes. sv_setsv does bail out almost instantly if source and dest SV*s are the same, but pp_sassign goes through alot of code until it calls sv_setsv.

    Sadly, your best bet is to write a Perl 5 to .NET CIL or Java bytecode compiler since pretty much all CPUs nowadays are tuned to running one of those 2 VMs.
      Sadly, your best bet is to write a Perl 5 to .NET CIL or Java bytecode compiler since pretty much all CPUs nowadays are tuned to running one of those 2 VMs.

      Elaboration or pointers?


      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.

      The start of some sanity?