On Tue, 12 Nov 2002 12:25:57 -0500, hou, ming wrote:

>I would like to know that there is a perl compiler to compile
>Perl program to system native code, because I have trouble
>with slow performance of Perl execution.

No, not really. There is perlcc, but that is, and likely always will
remain, beta, plus: the results won't be much faster than plain Perl.
The reason is because the native code isn't. Native, I mean. It's still
basically the same bytecode. So runtime speed will also be in the same
neighbourhood.

Most of the time, if you're having trouble with slow performance in
Perl, the best approach is to use better algorithms. Perl is pretty fast
as it is, For example, execution time of a regex match is typically in
the neighbourhood of 10 microseconds. (Exact timings depend strongly on
the computer, of course)

So, profile your code. That will help you in determining which sections
need tweaking the most. There's an interesting series on Perl written by
Brian d Foy for Dr Dobbs' Journal. (www.ddj.com) Profiling is delt with
in this article:

        <http://www.ddj.com/documents/s=1498/ddj0104pl/0104pl001.htm>


And if all this fails to deliver, you can still rewrite some often
called and relatively slow core functions in C, using XS or Inline::C.

   HTH,
   Bart.

Reply via email to