Mark-Jason Dominus, Chief Programmer, Plover Systems Co.
Track: Perl
Date: Tuesday, August 2nd, 2005
Time: 1:30pm - 5:00pm
Location: Portland 255
Almost every application must be made to run faster; some sooner, some
later. Performance tuning of applications has long been a dark art,
understood by few and riddled with terrible pitfalls. Stories abound
of optimization projects that took weeks but yielded a pathetic 2%
decrease in total run time. Don't let this happen to you.
The class begins with a brief introduction to the basic concepts
of performance tuning. We'll then take an extensive look at modules
for benchmarking and profiling, including reasons why you should avoid
the standard Perl 'Benchmark' module, instructions for using the new
'Benchmark::Accurate' module, and common errors that even experts
commit when benchmarking. We'll finish with a discussion of a few of
the most important optimizations.
Throughout, the class emphasizes a rational, cost-benefit approach
to performance tuning, discussing how to decide when to do performance
tuning, alternative approaches, and presenting many amusing anecdotes
and cautions about philosophical errors (such as the '1+1=0 principle'
of optimizations) that can cost you time and money.
Outline:
I. Preliminaries: Different kinds of time; bogus optimizations; I/O-, CPU-, and memory-bound programs; measurement tools; Benchmark.pm.
II. Profiling examples: Mail folder analyzer; speeding up the perldoc program; the 90-10 rule; writing your own profiling tools.
III. Common blunders: Pseudo-hashes; the missing 15%; premature optimization; numerical calculation; Jackson's rules.