#33070 [Opn->Fbk]: bzdecompress inefficient
| From: | tony2001@php.net | Date: | Thu, 19 May 2005 21:44:06 +0000 |
| Subject: | #33070 [Opn->Fbk]: bzdecompress inefficient | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79229@lists.php.net to get a copy of this message | ||
ID: 33070
Updated by: tony2001@php.net
Reported By: lindsay at bitleap dot com
-Status: Open
+Status: Feedback
Bug Type: Performance problem
Operating System: Linux 2.6.10 kernel
PHP Version: 5.0.3
New Comment:
Please provide a short but complete reproduce script and (if possible)
the data too.
Previous Comments:
------------------------------------------------------------------------
[2005-05-19 17:22:47] lindsay at bitleap dot com
Description:
------------
I found bug #13860 regarding bzdecompress speeds on 4.2.x. The bug
suggests its fixed for 4.2.0 but I see slowness in 5.0.3.
On 5.0.3, bzdecompress seems to get exponentionally slower as data
sizes increase. I timed the length of decompression on increasing file
sizes containing compressed random data:
file length 256K ran in: 2 seconds
file length 512K ran in: 10 seconds
file length 1M ran in: 41 seconds
file length 2M ran in: 135 seconds
file length 3M ran in: 278 seconds
file length 4M ran in: 476 seconds
I'm not a c coder but the do while loop at line 472 of:
http://cvs.php.net/co.php/php-src/ext/bz2/bz2.c?r=1.9
seems to decompress the string over and over. Each iteration attempts
a decompress w/ a buffer size based on the iteration count. If the
decompress fails, a larger buffer is tried. If I'm reading this
correctly, the same data could be decompressed hundreds of times until
the buffer gets large enough.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33070&edit=1