in reply to performance questions regarding cgi & fastcgi with Perl and C++
A local network connection, though, may be fast enough so that real processing time makes a difference.*
The big slowdown for perl CGI is the time it takes to load the interpreter and program code/modules, since CGI reloads everything for each request, but if your perl code is relatively small, and system load is low, disk caching etc may help bring down the load time if you run the same process repeatedly. (having a shared perllib instead of a static perl binary may help too, I guess).
If your perl program (including the modules it uses) is relatively large, or you've got a lot of requests to handle, using a system (like fastcgi) where you have the process (or multiple processes) running in a loop, handling one request after another without reloading is usually a great benefit, easily capable of increasing the performance 10 to 100 times. Especially since continual processes can make caching of (intermediate) processing a lot easier and faster.
* (update) AFAIK on linux at least, local (loopback) network connections can be shortcut - ignoring much of the network subsystem - that means they can be a lot faster than the maximum speed of the actual network system. In any case, I would guess that on many systems, a connection to localhost would not be dependent on the actual network hardware.
|
|---|