#33070 [NEW]: bzdecompress inefficient
| From: | lindsay at bitleap dot com | Date: | Thu, 19 May 2005 15:22:49 +0000 |
| Subject: | #33070 [NEW]: bzdecompress inefficient | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-79213@lists.php.net to get a copy of this message | ||
From: lindsay at bitleap dot com
Operating system: Linux 2.6.10 kernel
PHP version: 5.0.3
PHP Bug Type: Performance problem
Bug description: bzdecompress inefficient
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 bug report at http://bugs.php.net/?id=33070&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33070&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33070&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33070&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33070&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33070&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33070&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33070&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33070&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33070&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33070&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33070&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33070&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33070&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33070&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33070&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33070&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33070&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33070&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33070&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33070&r=mysqlcfg