Re: Optimization

Michal Young (young@cs.purdue.edu)
Sat, 25 Mar 1995 11:58:25 -0500


Message-Id: <199503251656.LAA02932@aleta.cs.purdue.edu>
Date: Sat, 25 Mar 1995 11:58:25 -0500
To: Kim.Lo@amgen.com, Multiple recipients of list <www-html@www10.w3.org>
From: young@cs.purdue.edu (Michal Young)
Subject: Re: Optimization


>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
>estimate)

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

----------------------
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
URL:   http://www.cs.purdue.edu/people/young
-----------------------