|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27126 Filling an array with php on Solaris is really slow.
Submitted: 2004-02-03 02:45 UTC Modified: 2004-02-04 02:36 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mike at schreiber dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: Irrelevant OS: Solaris 6-10beta
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mike at schreiber dot com
New email:
PHP Version: OS:


 [2004-02-03 02:45 UTC] mike at schreiber dot com
While filling an array with about 400.000 Elements on a solaris box took several seconds to be done. On other OS or for example Java und Sun took only a few mill-seconds.

The debugger reports, that php ist trying to fetch memory for every element in the array. This is the reason why it get so slow.

I have tried different Solaris Versions and different php versions. It is the compination of solaris and php.
Linux und Solaris (same hardware) is much more faster.

Reproduce code:
               function GetMicrotime(){
               list($microseconds, $seconds) = explode(" ",microtime());
               return ((float)$microseconds + (float)$seconds);

               $start  = GetMicrotime();
               $ende  = GetMicrotime();
                               $great_dump[] = array(1234,1234,1234);
               $ende  = GetMicrotime();
               $time  = $ende - $start;
               echo "\n";
               echo sizeof($great_dump);

Expected result:
less then one second

Actual result:
took me about 6,3 seconds

 0.1541 brk(0x003EC3A8)                                 = 0
 0.1542 brk(0x003EC3A8)                                 = 0
 0.1543 brk(0x003EE3A8)                                 = 0
 0.1544 brk(0x003EE3A8)                                 = 0
 0.1545 brk(0x003F03A8)                                 = 0
 0.1546 brk(0x003F03A8)                                 = 0
 0.1547 brk(0x003F23A8)                                 = 0
 0.1548 brk(0x003F23A8)                                 = 0
 0.1549 brk(0x003F43A8)                                 = 0
 0.1550 brk(0x003F43A8)                                 = 0
 0.1551 brk(0x003F63A8)                                 = 0
continues about 3500 times


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-03 10:27 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Given that the code runs at different speed across various 
platforms, I'd say this a platform issue more then anything 
 [2004-02-04 02:36 UTC] mike at schreiber dot com
Maybe it's not a bug, but it is a serious performance problem. I hope the php group will catch an eye on it in their further development. Furthermore i hope the php group is interested to run, test and support their software on different platforms.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 01:01:28 2024 UTC