[mod_python] questions/ideas

Gregory (Grisha) Trubetskoy grisha at modpython.org
Mon May 13 14:59:34 EST 2002


On Mon, 13 May 2002, Johannes Erdfelt wrote:

> On Mon, May 13, 2002, Michal Vitecek <fuf at mobil.cz> wrote:
>
> >     c) the publisher submodule reads the whole output of a function to a
> >        variable - for a sites with large html pages this could be 100s of
> >        KBs. this could mean a noticeable performance slowdown - also
> >        because the output must be prepared first. how about if the
> >        function output the resulting html code to a stream?
>
> Have you measured a decrease in performance?

You can, btw write to a stream if you need to, even from publisher scripts
- you just have to call req.send_http_header() manually first, and after
that you can write to the socket using req.write(). This technique is
useful for doing things like a traceroute script in which you want lines
to appear as soon as data is available.

Grisha




More information about the Mod_python mailing list