From da09661133f307d85bb4af54945611a44b1d907f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Sun, 21 Dec 2008 10:22:27 +0100 Subject: [PATCH] Add the perlperf manpage, by Richard Foley --- MANIFEST | 3 +- pod.lst | 2 + pod/perl.pod | 2 + pod/perlperf.pod | 1183 ++++++++++++++++++++++++++++++++++++++++++++++ pod/perltoc.pod | 78 +++ vms/descrip_mms.template | 22 +- win32/pod.mak | 4 + 7 files changed, 1284 insertions(+), 10 deletions(-) create mode 100644 pod/perlperf.pod diff --git a/MANIFEST b/MANIFEST index c89f105..8ad939a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1667,9 +1667,9 @@ lib/Attribute/Handlers/t/data_convert.t Test attribute data conversion lib/Attribute/Handlers/t/linerep.t See if Attribute::Handlers works lib/Attribute/Handlers/t/multi.t See if Attribute::Handlers works lib/attributes.pm For "sub foo : attrlist" -lib/autodie.pm Functions suceed or die with lexical scope lib/autodie/exception.pm Exception class for autodie lib/autodie/exception/system.pm Exception class for autodying system() +lib/autodie.pm Functions suceed or die with lexical scope lib/AutoLoader.pm Autoloader base class lib/AutoLoader/t/01AutoLoader.t See if AutoLoader works lib/AutoLoader/t/02AutoSplit.t See if AutoSplit works @@ -3440,6 +3440,7 @@ pod/perlopentut.pod Perl open() tutorial pod/perlop.pod Perl operators and precedence pod/perlothrtut.pod Old Perl threads tutorial pod/perlpacktut.pod Perl pack() and unpack() tutorial +pod/perlperf.pod Perl Performance and Optimization Techniques pod/perl.pod Perl overview (this section) pod/perlpod.pod Perl plain old documentation pod/perlpodspec.pod Perl plain old documentation format specification diff --git a/pod.lst b/pod.lst index 525e340..d33c782 100644 --- a/pod.lst +++ b/pod.lst @@ -26,6 +26,8 @@ h Tutorials perltooc Perl OO tutorial, part 2 perlbot Perl OO tricks and examples + perlperf Perl Performance and Optimization Techniques + perlstyle Perl style guide perlcheat Perl cheat sheet diff --git a/pod/perl.pod b/pod/perl.pod index 3164521..3a10eaa 100644 --- a/pod/perl.pod +++ b/pod/perl.pod @@ -41,6 +41,8 @@ For ease of access, the Perl manual has been split up into several sections. perltooc Perl OO tutorial, part 2 perlbot Perl OO tricks and examples + perlperf Perl Performance and Optimization Techniques + perlstyle Perl style guide perlcheat Perl cheat sheet diff --git a/pod/perlperf.pod b/pod/perlperf.pod new file mode 100644 index 0000000..3faf364 --- /dev/null +++ b/pod/perlperf.pod @@ -0,0 +1,1183 @@ +=head1 NAME + +perlperf - Perl Performance and Optimization Techniques + +=head1 DESCRIPTION + +This is an introduction to the use of performance and optimization techniques +which can be used with particular reference to perl progams. While many perl +developers have come from other languages, and can use their prior knowledge +where appropriate, there are many other people who might benefit from a few +perl specific pointers. If you want the condensed version, perhaps the best +advice comes from the renowned Japanese Samurai, Miyamoto Musashi, who said: + + "Do Not Engage in Useless Activity" + +in 1645. + +=head1 OVERVIEW + +Perhaps the most common mistake programmers make is to attempt to optimize +their code before a program actually does anything useful - this is a bad idea. +There's no point in having an extremely fast program that doesn't work. The +first job is to get a program to I do something B, (not to +mention ensuring the test suite is fully functional), and only then to consider +optimizing it. Having decided to optimize existing working code, there are +several simple but essential steps to consider which are intrinsic to any +optimization process. + +=head2 ONE STEP SIDEWAYS + +Firstly, you need to establish a baseline time for the existing code, which +timing needs to be reliable and repeatable. You'll probably want to use the +C or C modules, or something similar, for this step, +or perhaps the unix system C