FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP 4 vs 5 timings
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
PHP 4 vs 5 timings [message #174816] Mon, 11 July 2011 20:47 Go to next message
Billy Mays is currently offline  Billy Mays
Messages: 4
Registered: July 2011
Karma: 0
Junior Member
Has anyone done tests to see if php5 is significantly faster than php4?
I tried looking at some tests online, but none of them seem to test
scientifically. I am currently in a shared hosting environment so I am
limited in my ability to actually do the tests myself, and I would
prefer to not take my site down to test the difference.

--
Bill
Re: PHP 4 vs 5 timings [message #174818 is a reply to message #174816] Mon, 11 July 2011 21:31 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 7/11/2011 4:47 PM, Billy Mays wrote:
> Has anyone done tests to see if php5 is significantly faster than php4?
> I tried looking at some tests online, but none of them seem to test
> scientifically. I am currently in a shared hosting environment so I am
> limited in my ability to actually do the tests myself, and I would
> prefer to not take my site down to test the difference.
>
> --
> Bill

If you're on a shared host, any difference in timing will be
overshadowed by other activity on that host. Additionally, timings will
be heavily dependent on system configuration, so unless you can control
the exact configuration for your timing test and use a dedicated host,
any results you get will be meaningless anyway.

If you have a performance problem, you need to find the problem.
Otherwise you're just prematurely optimizing.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: PHP 4 vs 5 timings [message #174825 is a reply to message #174818] Tue, 12 July 2011 12:26 Go to previous messageGo to next message
Billy Mays is currently offline  Billy Mays
Messages: 4
Registered: July 2011
Karma: 0
Junior Member
On 07/11/2011 05:31 PM, Jerry Stuckle wrote:
> On 7/11/2011 4:47 PM, Billy Mays wrote:
>> Has anyone done tests to see if php5 is significantly faster than php4?
>> I tried looking at some tests online, but none of them seem to test
>> scientifically. I am currently in a shared hosting environment so I am
>> limited in my ability to actually do the tests myself, and I would
>> prefer to not take my site down to test the difference.
>>
>> --
>> Bill
>
> If you're on a shared host, any difference in timing will be
> overshadowed by other activity on that host. Additionally, timings will
> be heavily dependent on system configuration, so unless you can control
> the exact configuration for your timing test and use a dedicated host,
> any results you get will be meaningless anyway.
>
> If you have a performance problem, you need to find the problem.
> Otherwise you're just prematurely optimizing.
>

I did test to see which one had a shorter execution time since my host
supports both. I have put time into speed testing code.

I performed 1000 queries (using ab) and found that the median time was
regularly 10ms - 8ms faster with PHP5. However, the mean run time for
PHP4 (~180ms) along with the stddev (46ms) showed that the the PHP5
timings were not statistically significant. I know there are numerous
other factors at play, but knowing nothing else I would say that they
are about the same speed.

What I am actually concerned with is parsing speed. My website keeps a
gzipped cache of pages when clients make requests. Subsequent requests
cause PHP to check to see if the file is cached, and if so, send it to
the client (still gzipped) and die. Since my host doesn't have APC
installed, and since the PHP script that generates the page is fairly
large (~1000 lines), I suspected that PHP would waste time parsing the
whole script but then only execute the top 20 lines. My hope was that
PHP5 parsed faster, even if it executed at the same speed.

--
Bill
Re: PHP 4 vs 5 timings [message #175141 is a reply to message #174825] Tue, 16 August 2011 20:38 Go to previous message
Jo Schulze is currently offline  Jo Schulze
Messages: 15
Registered: January 2011
Karma: 0
Junior Member
Billy Mays wrote:

> and since the PHP script that generates the page is fairly
> large (~1000 lines), I suspected that PHP would waste time parsing the
> whole script but then only execute the top 20 lines.

Yes it will. Just as it did with PHP4.

> My hope was that
> PHP5 parsed faster, even if it executed at the same speed.

Because of magic or what? Zend Engine 2 (as used in PHP5) is an
improvement, but I doubt parsing speed will significantly increase.

However, I see no drawback.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Calling stored procedure on remote SQL Server machine with PDO
Next Topic: Adding a record to a database
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 23:53:44 GMT 2024

Total time taken to generate the page: 0.02569 seconds