PHP 5.2.4 slower than PHP 5.2.3
Moderator: General Moderators
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
PHP 5.2.4 slower than PHP 5.2.3
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?
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?
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
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.
Although, post your testing code.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
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.
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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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.
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
Both are original compiles from http://www.php.net/.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.
I assume they use the same compiler, especially for a minor update from PHP 5.2.3 to PHP 5.2.4.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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.WaldoMonster wrote:Both are original compiles from http://www.php.net/.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.
I assume they use the same compiler, especially for a minor update from PHP 5.2.3 to PHP 5.2.4.
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
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
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.
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>