O'Reilly Open Source Convention
oreilly.comO'Reilly Network
Conferences International Safari: Books Online


Arrow Home
Arrow Registration
Arrow Speakers
Arrow Keynotes
Arrow Tutorials
Arrow Sessions
Arrow At-a-Glance
Arrow BOFs
Arrow Events
Arrow Exhibitors
Arrow Sponsors
Arrow Hotel/Travel
Arrow Venue Map
Arrow See & Do
Arrow Press
Arrow Mail List
Kids World


From the Frontiers of Research to the Heart of the Enterprise
O'Reilly Open Source Convention
Sheraton San Diego Hotel and Marina
July 22-26, 2002 -- San Diego, CA


Apache

Tutorial

Optimize Your Perl Code
Robert Spier, Google

Track: Perl
Date: Tuesday, July 23
Time: 8:45am - 12:15pm
Location: Grande Ballroom B

This tutorial is an introduction to optimizating perl applications. It's important knowledge for anyone writing time-sensitive applications, from a CGI script to a large application.

It covers the following four major components:

  1. A brief introduction to complexity theory
    Just enough complexity theory to have a basic language to talk about runtimes of functions. O(1), O(n), O(n^2), etc. Complexity of common perl idioms like map, sort, nested loops, etc. Why is some code slow? (And it's not perl's fault!)
  2. Real world / real code examples and how to make them faster
    Examples of O(n^2) or worse functions and how they can be improved by an order of magnitude by rewriting the algorithm, and possibly changing the data structures used to store things. Memoization/Caching/Persistency/Precomputing.
  3. Some simple Benchmarking
    Devel::DProf and Benchmark.pm can help to isolate problem spots in your code. Learn how to properly interpret data and how to pick the "important" pieces.
  4. Is it worth it?
    Not all time spent optimizing the code is worth it. There are tradeoffs of time, readability, speed. Discuss development strategies, pre-optimization, and over-optimization. O(n) can be faster than O(1) for small n.



oreilly.com Home | O'Reilly Bookstores | How to Order | O'Reilly Contacts
International | About O'Reilly | Affiliated Companies | Privacy Policy


© 2001, O'Reilly Media, Inc.
conf-webmaster@oreilly.com