[hunchentoot-devel] Hunchentoot data-transfers seem slow

Robert Synnott rsynnott at gmail.com
Fri Mar 23 00:23:55 UTC 2007


On 3/22/07, Edi Weitz <edi at agharta.de> wrote:
> On Thu, 22 Mar 2007 12:39:40 +0000, "Robert Synnott" <rsynnott at gmail.com> wrote:
>
> > I was really just using the big static file to demonstrate the
> > problem; it's visible when sending dynamically generated pages as
> > well, but just not by so huge a margin (because the pages aren't as
> > big, I think; the bigger the page, the more the speed difference
> > between tbnl and hunchentoot seems to be).
>
> I've just uploaded a new release of FLEXI-STREAMS (0.11.1) which
> incorporates the patches I was talking about.  This should make
> Hunchentoot output significantly faster /if/ you're using an 8-bit
> encoding without line encoding conversions (like the default format),
> but it'll still be an order of magnitude slower than writing binary
> data directly to the stream.
>
> Let us know if this helps.
>
> I'm happy to accept reasonable patches to make FLEXI-STREAMS faster,
> but obviously there's a certain price you have to pay for flexibility
> and portability.
>
> Note that you can of course bypass FLEXI-STREAMS if you absolutely
> need the speed.  Something like this (untested):
>
>   (defun my-handler ()
>     ;; no need to generate the content before calling SEND-HEADERS,
>     ;; but that way your errors will be handled by Hunchentoot
>     (let ((content (generate-content))
>           (stream (flexi-stream-stream (send-headers))))
>       (write-sequence (maybe-convert content) stream)))
>
> Try it...
>
> STREAM will either be the raw socket stream or a chunked stream from
> Chunga depending on how you've started your server.  (You can put
> Hunchentoot behind mod_lisp and use :INPUT-CHUNKING-P NIL and
> :MOD-LISP-P T to bypass Chunga as well.)
> _______________________________________________
> tbnl-devel site list
> tbnl-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/tbnl-devel
>

Hi,
This works perfectly; it's nearly as fast as tbnl, and certainly fast
enough that it's not a worry; when putting together my new site, I
know it's there to fall back on if speed does become an issue.
Thanks
Rob



More information about the Tbnl-devel mailing list