Re: Performance analysis questions

George Phillips (phillips@cs.ubc.ca)
13 May 94 11:53 -0700


Andrew Payne wrote:
>Actually, you can get the best of both methods. Read the first 4 bytes of
>the connection. If the method is POST, read the rest of the connection
>unbuffered and hand the socket off to the script. Otherwise, do large
>block reads and buffer all you'd like. If you seek the ultimate in
>performance, the extra code might be worth it.

Exactly. My suggestion was for a quick hack to halve the processing
time. What you suggest is the right way to fix it. Note that you
can read more than 4 bytes. Assume generosity on what your server
accepts, the minimal HTTP/1.0 request is "GET / HTTP/1.0<LF><LF>".
16 bytes. That will still work with HTTP/0.9 requests since the
record boundary will cut your read short, if necessary.