PHP4 B2 slower with Arrays than PHP3
| From: | Mark Nold | Date: | Fri, 12 Nov 1999 06:41:18 +0000 |
| Subject: | PHP4 B2 slower with Arrays than PHP3 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12336@lists.php.net to get a copy of this message | ||
Hi,
I was just playing around with PHP4 B2 on Win98 and comparing it PHP 3.0.9 on the same platform.
Both run as CGI with PWS.
My test script creates a 2D array of 1000 x 5 members and then creates a table (doesnt echo it
though). It makes extensive use of
while(list($key,$row) = each($ary)){
while(list($col,$val) = each($row)){
//draw a table row....
}
}
To traverse the arrays. My problem is that on PHP4 beta its twice as slow as 3.0.9. Is this not the
most optimum method? Is this an issue for optimisation?
Large 2D arrays (well not 1000 members though) are what i spend a lot of time on as well as a few
others, mainly for reporting and analysis.
If anybody knows why id be interested to hear, (im not on this list so please CC me) and if
you'd like the source of my tests id be glad to send it either direct or again to this list.
Thanks guys for a great piece(s) of software.
mn
Mark Nold
markn@alverstone.com.au
Systems Consultant
"Change is inevitable - except from vending machines"