Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Perl compiler request - flogging the dead horse!

by sundialsvc4 (Abbot)
on Feb 04, 2014 at 01:27 UTC ( #1073294=note: print w/replies, xml ) Need Help??

in reply to Perl compiler request - flogging the dead horse!

Also, “a Perl compiler” probably wouldn’t actually “speed it up” nearly as much as you might think.   Perl, as a language system, is actually very small in size ... and very, very fast.   (There is voodoo in those perlguts.)   Like every interpreted language that is designed to be interpreted, the source-code is compiled in a split-second, not to executable machine code, but to an optree that is then traversed by the runtime system.   A single optree node can pack a tremendous punch, or it can do very little, but it is always small.   The overhead of navigating through that structure and calling the proper handlers is inconsequential.   The key advantage of the optree is that it expresses the purpose of the program, the actions that are to be taken, and that it does it all indirectly.   The code that implements each opcode is already ferociously optimized:   you’ve got access to some top-notch code without so much as lifting a finger.

If your program is “slow,” then it is your program that is slow, and compiling that program into an assemblage of native instructions would not make it faster.   Instead, profile your program to find the hot-spots ... do not “guess” where they are, and do expect to be surprised.   80% of the program’s runtime is generally spent in 20% of the code.   Correctly and objectively identifying those troubled areas, and creating highly-targeted improvements based on actual measures, will yield dramatic performance improvement.

  • Comment on Re: Perl compiler request - flogging the dead horse!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1073294]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2018-02-23 03:21 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (300 votes). Check out past polls.