PHP 5.2.4 slower than PHP 5.2.3

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

PHP 5.2.4 slower than PHP 5.2.3

Post 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?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

You'd have to show us the script, so we can try reproducing the benchmark.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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. :P

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.
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
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.
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 ;)
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Post 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>
Post Reply