Re: Optimization

Michal Young (
Sat, 25 Mar 1995 12:07:41 +0500

>Second, with regards to CGI, do you know what is the difference in
>performance when writting perl script or C code? (Give me a percentage

A common mistake in choosing what/whether to optimize is to consider the
speedup obtainable in a portion of the task under consideration, without
adequate analysis of the contribution of that portion to the whole task.
You need to ask: What portion of the total latency in sending a request,
processing it, and receiving a reply is spent executing a Perl script, and
how much faster would it be if the script were a binary executable? For
some tasks, the execution time will be significant, and optimizing it will
be a sensible step. For most tasks it wouldn't matter even if the C code
ran 1000 times faster than the Perl code. There is no substitute for actual
measurements of the behavior of a particular application. The telescope
builder's rule is also applicable here: It's faster to build a 3" lens and
then a 5" lens, than to build a 5" lens.


Michal Young
Purdue University
Software Engineering Research Center
Department of Computer Sciences
1398 Computer Science Building
West Lafayette, IN 47907-1398
voice: 317-494-6023
fax: 317-494-0739