Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl compiler request - flogging the dead horse!

by sundialsvc4 (Monsignor)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-08-02 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls