At 20:07 14/1/2001, Jim Studt wrote:
>Zeev Suraski wrote...
> > I haven't looked into this patch, but can't this be done using the chunked
> > output buffering support?  A 4KB buffer should be much more efficient than
> > compressing each and every separate piece of output...  The chunked output
> > buffering support made it into 4.0.4, although it's untested, and
> > ob_gzhandler() wasn't yet updated to take advantage of it.
>I was unaware of chunked output.  I have now read the code.  I like
>the idea for very high data throughput servers.  I'm not sure it will
>make much difference in a compression situation.  The CPU consumed
>doing compression is so much larger than the cost of the extra
>function calls that the compression time will strongly dominate.

I'm not exactly sure as to how gzip compression works, but won't it also 
improve the compression ratios?  I assume it compresses data in chunks (you 
can't really compress 1 byte)...

>I believe chunking will work out-of-the-box with my compression patch,
>if there is someway to do the chunking with the standard output
>handler.  I didn't see one but can imagine how to add one.  (Allow a 0
>for the handler argument in the two argument form of ob_start(), use
>that to indicate the standard handler).  If you like I will add this
>and collect some performance data.
>I believe ob_gzhandler will need a major rework to use chunking.  The
>trick is that ob_gzhandler puts the header and trailer on the content
>all in one call.  If it is going to be called many times for the same
>request then it needs to know which is the first (easy) and which is
>the last (needs new mechanisms elsewhere in php).  Proper flushing
>also requires other hooks in both the compression and I think the
>chunking code.

True, ob_gzhandler() will have to hold a state...

Generally I'd rather keep the API the same, if possible.  Unless you see a 
major advantage to changing it..?


Zeev Suraski <[EMAIL PROTECTED]>
CTO &  co-founder, Zend Technologies Ltd.

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to