[tbnl-devel] TBNL stream

Edi Weitz edi at agharta.de
Thu May 5 20:41:10 UTC 2005


On Thu, 5 May 2005 19:41:56 +0200, Peter BARABAS <peter.barabas at 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.



More information about the Tbnl-devel mailing list