Page 1 of 1
PHP 5.2.4 slower than PHP 5.2.3
Posted: Sat Sep 01, 2007 5:02 pm
by WaldoMonster
A scripted that I have timed:
PHP 5.2.3: 20 ms
PHP 5.2.3 + eAccelrator: 12 ms
PHP 5.2.4: 28 ms
PHP 5.2.4 + eAccelrator: 20 ms
Both tested on a Windows machine.
Many other scripts are slower on PHP 5.2.4
Someone have the same experience?
Posted: Sat Sep 01, 2007 8:20 pm
by Ambush Commander
You'd have to show us the script, so we can try reproducing the benchmark.
Posted: Sat Sep 01, 2007 8:23 pm
by s.dot
New releases don't have to be faster. Just more security fixes and bug fixes, and more stable. I'd risk 8ms for that.
Although, post your testing code.
Posted: Sun Sep 02, 2007 2:41 am
by WaldoMonster
I haven't used an isolated test script.
I have used netjukebox with a specific view (action=view1&filter=start&artist=w) witch also displays the execution time.
I will post an isolate script with the execution time in the next days.
Posted: Sun Sep 02, 2007 2:58 am
by s.dot
There are so many facters that can play into the page execution time, especcially settings and php versions, and even more so, settings in separate php versions.
To do an acurrate test you need to have lots of controls. Same server. Same operating system. Same memory/cpu usage. So much control that the only possible factor to determine the speed of the code is the speed of the code itself.
Ideally, anyways.
Posted: Sun Sep 02, 2007 3:44 am
by WaldoMonster
I have done testing on the same server with the same OS, Database, Webserver, PHP script from the same location and the same php.ini except from the eAccelrator part of cource.
Posted: Sun Sep 02, 2007 5:00 am
by Chris Corbyn
Tetsting on a windows machines isn't really a fair test because the windows versions are precompiled binaries and it really depends upon how the binary was compiled as to how fast it will run on on various systems. If you compiled the source with the same compiler and optimizations flags on your own PC for each of these tests the results would be a tad more reliable.
Posted: Sun Sep 02, 2007 6:20 am
by WaldoMonster
d11wtq wrote:Tetsting on a windows machines isn't really a fair test because the windows versions are precompiled binaries and it really depends upon how the binary was compiled as to how fast it will run on on various systems. If you compiled the source with the same compiler and optimizations flags on your own PC for each of these tests the results would be a tad more reliable.
Both are original compiles from
http://www.php.net/.
I assume they use the same compiler, especially for a minor update from PHP 5.2.3 to PHP 5.2.4.
Posted: Sun Sep 02, 2007 7:04 am
by Chris Corbyn
WaldoMonster wrote:d11wtq wrote:Tetsting on a windows machines isn't really a fair test because the windows versions are precompiled binaries and it really depends upon how the binary was compiled as to how fast it will run on on various systems. If you compiled the source with the same compiler and optimizations flags on your own PC for each of these tests the results would be a tad more reliable.
Both are original compiles from
http://www.php.net/.
I assume they use the same compiler, especially for a minor update from PHP 5.2.3 to PHP 5.2.4.
But they may have been compiled on different computers. If I compile C code to machine code on one PC, then do the same on a different PC and go to a third PC and test both for speed, they will differ. This is why many UNIX geeks like to simply compile source code on their own machines, because they'll get the most optimal performance.
I don't doubt that 5.2.4 is slower than 5.2.3, I just don't think downloading the windows binary and then tooting about an 8ms difference on code we can't even see is really a fair test

Posted: Tue Sep 04, 2007 7:51 am
by WaldoMonster
I have done testing with a simple isolated script.
The differences are now much smaller.
Maybe the differences are smaller because it only contains one query.
Code: Select all
<?php
$start_time = microtime(true);
$db = mysqli_connect('localhost', 'username', 'password', 'netjukebox');
$query = mysqli_query($db, 'SELECT artist_alphabetic, album
FROM album
ORDER BY artist_alphabetic, album');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>list</title>
</head>
<body>
<table cellspacing="0" cellpadding="2" border="1">
<tr>
<td align="center">nr</td>
<td>Artist</td>
<td>Album</td>
</tr>
<?php
$i = 1;
while ($album = mysqli_fetch_array($query))
{
?>
<tr>
<td align="right"><?php echo $i++; ?></td>
<td><?php echo htmlentities($album['artist_alphabetic']); ?></td>
<td><?php echo htmlentities($album['album']); ?></td>
</tr>
<?php
}
?>
</table>
<br>
<?php echo number_format((microtime(true) - $start_time) * 1000, 1); ?> ms
</body>
</html>