Hello,
TBNL expects a string to be returned from the dispatch functions, which it will send to the HTTP client. Is there a stream that I can output my HTML to, to avoid consing?
Thank you in advance.
On Thu, 5 May 2005 19:41:56 +0200, Peter BARABAS peter.barabas@gmail.com wrote:
TBNL expects a string to be returned from the dispatch functions, which it will send to the HTTP client. Is there a stream that I can output my HTML to, to avoid consing?
Not directly, no. This is a deliberate design decision of TBNL which has the advantage that at any time during the generation of the output TBNL's error handling (or yours) can intervene and send something meaningful to the client instead of, say, half a page of HTML followed by junk.
I've used TBNL for lots of different web apps and I've also benchmarked it more than once. I've never experienced a bottleneck due to this. Do you have actual performance problems or is this just pre-mature optimization? Have you profiled your code?
BTW, another important point is that mod_lisp will close the socket to Lisp on each request unless you send a valid "Content-Length" header. In most cases this is impossible unless you capture your output before sending it to mod_lisp. Having to re-open a socket on each request might as well be much more expensive than consing up a string.
Cheers, Edi.
PS: I might not be able to answer for a couple of days because I'll be on vacation.
On 5/5/05, Edi Weitz edi@agharta.de wrote:
On Thu, 5 May 2005 19:41:56 +0200, Peter BARABAS peter.barabas@gmail.com wrote:
TBNL expects a string to be returned from the dispatch functions, which it will send to the HTTP client. Is there a stream that I can output my HTML to, to avoid consing?
Not directly, no. This is a deliberate design decision of TBNL which has the advantage that at any time during the generation of the output TBNL's error handling (or yours) can intervene and send something meaningful to the client instead of, say, half a page of HTML followed by junk.
I see. It's a reasonable design philosophy.
I've used TBNL for lots of different web apps and I've also benchmarked it more than once. I've never experienced a bottleneck due to this. Do you have actual performance problems or is this just pre-mature optimization? Have you profiled your code?
The truth is that I was just curious. I haven't had a performance issue with TBNL.
BTW, another important point is that mod_lisp will close the socket to Lisp on each request unless you send a valid "Content-Length" header. In most cases this is impossible unless you capture your output before sending it to mod_lisp. Having to re-open a socket on each request might as well be much more expensive than consing up a string.
Indeed. Thanks for the details.
I hope my question wasn't too stupid.