apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: stupid bucket tricks
Date Thu, 27 Sep 2001 04:24:43 GMT
On Wednesday 26 September 2001 08:52 pm, Cliff Woolley wrote:
> On Wed, 26 Sep 2001, Cliff Woolley wrote:
> >     str = apr_psprintf(p,
> > "</PRE>\n\n<HR></HR>\n\n%s\n\n</BODY>\n</HTML>\n",
ap_psignature("", r));
> >     e = apr_bucket_pool_create(str, strlen(str), p);
> >     APR_BRIGADE_INSERT_TAIL(out, e);
> Or, alternately (meant to mention this in that last email), at what point
> does the brigade buffering system become an attractive replacement for the
> above?  You'd still be doing the copying, but at least then you'd still
> only have one bucket at the end and you wouldn't have to parse a format
> string...
> Just a thought.

The buffering system is almost always an attractive replacement unless you
are doing something with a file, socket, pipe, immortal data, or a LOT of
pre-allocated data.  Essentially, the improvement in readability and thus
understandability is worth the small performance loss.  The only real reason
to use the buckets directly is because for files, we will see a HUGE performance
gain due to sendfile, and for files, buckets, and immortal data, the buffering
stuff just can't do the job.

Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net

View raw message