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
Return to the default flat view Create a new topic Submit Reply
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 previous message
Billy Mays is currently offline  Billy Mays
Messages: 4
Registered: July 2011
Karma:
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
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 08:50:12 GMT 2024

Total time taken to generate the page: 0.04006 seconds