As Corion pointed out, Perl is an interpreted language. When you run a Perl script, it goes through a "compilation" stage, but that only takes it to a stage that is easier for the interpreter to deal with. And all this is contained within the single perl executable. There are much more recent versions of Perl available. ActiveState currently is dispensing version 5.8.6.

If your problem is startup time, you could convert your script to something that is "always on", just waiting (blocking) for input. Or if we're talking about CGI, you could switch over to mod_perl, which eliminates the startup cost of your script.

If your problem is runtime speed, profile to find the bottlenecks, and then rework the key segments of code that are slowing you down. You may find that the script is IO bound rather than CPU bound. Or you may find that there's a really poorly written algorithm somewhere that is taking O(n^2) (or worse) time. If you can rework a key algorithm from O(n^2) time to O(n log n), you gain a magnitude of better time efficiency. Convert O(n log n) to O(n), to O(log n), to O(1), and each time you realize a dramatic improvement in runtime speed. Maybe there's a situation where you should be using a hash instead of grepping a list, etc. But definately profile before optimizing so you'll know where to focus your efforts, and which small fish to let go.


Dave


In reply to Re: Which is the best compiler by davido
in thread Which is the best compiler by agynr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.