Sam said:
And the time taken to fork a process doesn't swamp any speed
benefit the C program might bring?
- The Perl part takes around 160 msec (140 msec for compilation, 20 msec
writing to stdout) & includes html whitespace removal
- fork on modern Linux/unix is < 1 msec
- logon to mysql from C is 3 msec, though I dont do that (yet).
- the C program is optimised (-O2 in gcc) & staticly linked
- Also some versions of Apache insist on generating a "Content Length" in
the header (eg Apache in Redhat 9) which means they run the cgi & buffer
stdout, calculate the content length, then send everything back to the
browser. Recent versions of Apache send content back to the browser as soon
as the cgi generates to stdout.
This whole process is designed to start sending content back to the browser
a few milliseconds after it hits the server.
I've written about related issues at:
http://gregorytoomey.com/index.php?option=content&task=view&id=2&Itemid=2
gtoomey