From da09661133f307d85bb4af54945611a44b1d907f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Sun, 21 Dec 2008 10:22:27 +0100 Subject: Add the perlperf manpage, by Richard Foley --- pod/perl.pod | 2 + pod/perlperf.pod | 1183 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ pod/perltoc.pod | 78 ++++ 3 files changed, 1263 insertions(+) create mode 100644 pod/perlperf.pod (limited to 'pod') diff --git a/pod/perl.pod b/pod/perl.pod index 31645218da..3a10eaa957 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 0000000000..3faf36485c --- /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