This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove the VM/ESA port.
[perl5.git] / pod / perlperf.pod
index 3faf364..007a02b 100644 (file)
@@ -5,7 +5,7 @@ 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
+which can be used with particular reference to perl programs.  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
@@ -30,8 +30,8 @@ optimization process.
 
 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<Benchmark> or C<Devel::DProf> modules, or something similar, for this step,
-or perhaps the unix system C<time> utility, whichever is appropriate.  See the
+C<Benchmark> or C<Devel::NYTProf> modules, or something similar, for this step,
+or perhaps the Unix system C<time> utility, whichever is appropriate.  See the
 base of this document for a longer list of benchmarking and profiling modules,
 and recommended further reading.
 
@@ -168,7 +168,7 @@ it managed to execute an average of 628,930 times a second during our test, the
 direct approach managed to run an additional 204,403 times, unfortunately.
 Unfortunately, because there are many examples of code written using the
 multiple layer direct variable access, and it's usually horrible.  It is,
-however, miniscully faster.  The question remains whether the minute gain is
+however, minusculy faster.  The question remains whether the minute gain is
 actually worth the eyestrain, or the loss of maintainability.
 
 =head2  Search and replace or tr
@@ -214,8 +214,7 @@ Running the code gives us our results:
             tr:  0 wallclock secs ( 0.49 usr +  0.00 sys =  0.49 CPU) @ 2040816.33/s (n=1000000)
 
 The C<tr> version is a clear winner.  One solution is flexible, the other is
-fast - and it's appropriately the programmers choice which to use in the
-circumstances.
+fast - and it's appropriately the programmer's choice which to use.
 
 Check the C<Benchmark> docs for further useful techniques.
 
@@ -446,7 +445,7 @@ reader program.  C<dprofpp> usage is therefore identical to the above example.
 Interestingly we get slightly different results, which is mostly because the
 algorithm which generates the report is different, even though the output file
 format was allegedly identical.  The elapsed, user and system times are clearly
-showing the time it took for C<Devel::Profiler> to execute it's own run, but
+showing the time it took for C<Devel::Profiler> to execute its own run, but
 the column listings feel more accurate somehow than the ones we had earlier
 from C<Devel::DProf>.  The 102% figure has disappeared, for example.  This is
 where we have to use the tools at our disposal, and recognise their pros and
@@ -568,7 +567,7 @@ to execute, C<if ( $debug ) { > and C<my $message = shift;>, for example.  The
 differences in the actual times recorded might be in the algorithm used
 internally, or it could be due to system resource limitations or contention.
 
-See also the L<DBIx::Profiler> which will profile database queries running
+See also the L<DBIx::Profile> which will profile database queries running
 under the C<DBIx::*> namespace.
 
 =head2 Devel::NYTProf
@@ -598,7 +597,7 @@ the code.
 C<NYTProf> will generate a report database into the file F<nytprof.out> by
 default.  Human readable reports can be generated from here by using the
 supplied C<nytprofhtml> (HTML output) and C<nytprofcsv> (CSV output) programs.
-We've used the unix sytem C<html2text> utility to convert the
+We've used the Unix system C<html2text> utility to convert the
 F<nytprof/index.html> file for convenience here.
 
     $> html2text nytprof/index.html
@@ -762,7 +761,7 @@ be quite useful as a simple filter:
 
 A command such as this can vastly reduce the volume of material to actually
 sort through in the first place, and should not be too lightly disregarded
-purely on the basis of it's simplicity.  The C<KISS> principle is too often
+purely on the basis of its simplicity.  The C<KISS> principle is too often
 overlooked - the next example uses the simple system C<time> utility to
 demonstrate.  Let's take a look at an actual example of sorting the contents of
 a large file, an apache logfile would do.  This one has over a quarter of a
@@ -945,7 +944,7 @@ Run the new code against the same logfile, as above, to check the new time.
 
 The time has been cut in half, which is a respectable speed improvement by any
 standard.  Naturally, it is important to check the output is consistent with
-the first program run, this is where the unix system C<cksum> utility comes in.
+the first program run, this is where the Unix system C<cksum> utility comes in.
 
     $> cksum out-sort out-schwarz
     3044173777 52029194 out-sort
@@ -1117,18 +1116,17 @@ Further reading can be found using the modules and links below.
 
 =head2 PERLDOCS
 
-For example: perldoc -f sort
+For example: C<perldoc -f sort>.
 
-    L<perlfaq4>
-    L<perlfork>
-    L<perlfunc>
-    L<perlretut>
-    L<perlthrtut>
-    L<threads>
+L<perlfaq4>.
+
+L<perlfork>, L<perlfunc>, L<perlretut>, L<perlthrtut>.
+
+L<threads>.
 
 =head2 MAN PAGES
 
-    L<time>
+C<time>.
 
 =head2 MODULES
 
@@ -1136,25 +1134,25 @@ It's not possible to individually showcase all the performance related code for
 Perl here, naturally, but here's a short list of modules from the CPAN which
 deserve further attention.
 
-    L<Apache::DProf>
-    L<Apache::SmallProf>
-    L<Benchmark>
-    L<DBIx::Profiler>
-    L<Devel::AutoProfiler>
-    L<Devel::DProf>
-    L<Devel::DProfLB>
-    L<Devel::FastProf>
-    L<Devel::GraphVizProf>
-    L<Devel::NYTProf>
-    L<Devel::NYTProf::Apache>
-    L<Devel::Profiler>
-    L<Devel::Profile>
-    L<Devel::Profit>
-    L<Devel::SmallProf>
-    L<Devel::WxProf>
-    L<POE::Devel::Profiler>
-    L<Sort::Key>
-    L<Sort::Maker>
+    Apache::DProf
+    Apache::SmallProf
+    Benchmark
+    DBIx::Profile
+    Devel::AutoProfiler
+    Devel::DProf
+    Devel::DProfLB
+    Devel::FastProf
+    Devel::GraphVizProf
+    Devel::NYTProf
+    Devel::NYTProf::Apache
+    Devel::Profiler
+    Devel::Profile
+    Devel::Profit
+    Devel::SmallProf
+    Devel::WxProf
+    POE::Devel::Profiler
+    Sort::Key
+    Sort::Maker
 
 =head2 URLS
 
@@ -1174,8 +1172,6 @@ Very useful online reference material:
 
     http://www.sysarch.com/Perl/sort_paper.html
 
-    http://www.unix.org.ua/orelly/perl/prog/ch08_03.htm
-
 =head1 AUTHOR
 
 Richard Foley <richard.foley@rfi.net> Copyright (c) 2008