Optimizing using precompiled Perl program?

Y

Yash

We have a compute-intensive Perl program that needs optimization. We
have done whatever we could on the algorithm front. Would it give any
performnace improvement if we convert the program to bytecode using:
perl -MO=Bytecode[,-H][,-oscript.plc] script.pl

We are looking for overall runtime performance improvement and not
just initial load-time improvement.

Can you suggest anything else for further optimization?

Thanks
 
R

Randal L. Schwartz

Yash> We have a compute-intensive Perl program that needs optimization. We
Yash> have done whatever we could on the algorithm front. Would it give any
Yash> performnace improvement if we convert the program to bytecode using:
Yash> perl -MO=Bytecode[,-H][,-oscript.plc] script.pl

Yash> We are looking for overall runtime performance improvement and not
Yash> just initial load-time improvement.

No. In fact, that might make your program run slower. :) Perl's
already at full speed by the time it's running.

Yash> Can you suggest anything else for further optimization?

Have you *really* used the profiling tools?

Have you started to Inline::C the hotspots?

Have you considered using PDL (in the CPAN) for your complex
data structures?

print "Just another Perl hacker,"; # the first (or is it 0th?)
 
A

Anno Siegel

Yash said:
We have a compute-intensive Perl program that needs optimization. We
have done whatever we could on the algorithm front. Would it give any
performnace improvement if we convert the program to bytecode using:
perl -MO=Bytecode[,-H][,-oscript.plc] script.pl

We are looking for overall runtime performance improvement and not
just initial load-time improvement.

Can you suggest anything else for further optimization?

Profile it to find possible hot spots. Devel::Dprof is the tool.

Anno
 
C

ctcgag

Yash said:
We have a compute-intensive Perl program that needs optimization. We
have done whatever we could on the algorithm front. Would it give any
performnace improvement if we convert the program to bytecode using:
perl -MO=Bytecode[,-H][,-oscript.plc] script.pl

We are looking for overall runtime performance improvement and not
just initial load-time improvement.

Can you suggest anything else for further optimization?

Profile it to find possible hot spots. Devel::Dprof is the tool.

I often find Devel::SmallProf more useful, especially for smaller projects.
Usually I already know what sub is consuming the time, and I want to know
which line within the sub is the hog.

Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top