Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2508

Re: PHP 4 vs 5 timings

From Billy Mays <noway@nohow.com>
Newsgroups comp.lang.php
Subject Re: PHP 4 vs 5 timings
Date 2011-07-12 08:26 -0400
Organization Aioe.org NNTP Server
Message-ID <ivheic$g55$1@speranza.aioe.org> (permalink)
References <ivfngo$lj5$1@speranza.aioe.org> <ivfq3f$hvj$2@dont-email.me>

Show all headers | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

PHP 4 vs 5 timings Billy Mays <noway@nohow.com> - 2011-07-11 16:47 -0400
  Re: PHP 4 vs 5 timings Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-11 17:31 -0400
    Re: PHP 4 vs 5 timings Billy Mays <noway@nohow.com> - 2011-07-12 08:26 -0400
      Re: PHP 4 vs 5 timings Jo Schulze <antispam@feuersee.de> - 2011-08-16 22:38 +0200

csiph-web