From:             rlillack at yasni dot de
Operating system: Ubuntu jaunty x86_64
PHP version:      5.3.1
PHP Bug Type:     Performance problem
Bug description:  performance regression handling objects, ten times slower in 
5.3.x

Description:
------------
PHP 5.3 did indeed introduce many performance improvements, but we 
spotted a rather hard regression with handling a large amount of 
objects that are allocated at the same time.

Running the following test case on one of our web servers yield this 
result with a vanilla build of 5.2.11:

time: 1.28 secs, memory usage 376.48 MiB.

and this with 5.3.1:

time: 13.44 secs, memory usage 400.62 MiB.

(command line in both cases: PREFIX/bin/php -d memory_limit=2G 
testcase.php)

The regression at least since the PHP 5.3 release candidates.

Both were fresh build straight from the tarball, No extensions, etc. 
Opcode caches do not help. --with-zend-vm does not help.


Reproduce code:
---------------
<?php
$start = microtime(TRUE);

$a = array();
foreach (range(1, 1000000) as $i) {
    $a []= new StdClass;
}

printf("time: %s secs, memory usage %s MiB.\n",
       number_format(microtime(TRUE) - $start, 2),
       number_format(memory_get_usage() / 1024 / 1024, 2));


Expected result:
----------------
PHP 5.3.1 should not be any slower than 5.2.11 is. :)

Actual result:
--------------
PHP 5.3.1 is ten times slower in this test case.

One of our apps does only handle 1/4th queries/s with 5.3 on a 
production server.

-- 
Edit bug report at http://bugs.php.net/?id=50351&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50351&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50351&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50351&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50351&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50351&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50351&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50351&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50351&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50351&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50351&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50351&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50351&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50351&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50351&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50351&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50351&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50351&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50351&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50351&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50351&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50351&r=mysqlcfg

Reply via email to