[Israel.pm] Article: Optimizing Perl

Gabor Szabo gabor at perl.org.il
Thu Oct 28 02:21:08 PDT 2004

I would not call that a nice article.

It starts with a number of examples on how to optimise.
Shows an example of two versions of some stupid academic code and
later on explains why profiling is not a big deal. (later he says he
does use profiling every time which confused me a bit)

In short he advocates premature (micro)optimisation.

But then actually I was not expecting anything good once I saw the
name of the author. I have encountered a number of his books and would
not recommend them to anyone.

He also shows a couple of micro optimisations (such as double quotes
single quotes ?) I have not heard this one yet. I keep hearing the
question which is faster:
print "$x$y";
print $x, $y;
print $x . $y;

Very nice. I just encountered a piece of code that was running slowly.
I immediately saw I could optimise it with one of the above ways and
gain maybe as much as 10-20%.

Or I can replace the database which was a DB file with a real SQL database
and get a speed improvement of about x50  (50 times faster).

Let's hear Shlomo about data structures ! :)


More information about the Perl mailing list