Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-27 Thread Nathan Nobbe
Stut wrote:

 Just wanted to pick you up on this. PHP is the only language you've
 listed that only has a single implementation. There are implementations
 of C++ compilers that are writting in other languages. I can't speak for
 Java since I have little experience but I'd be surprised if all
 implementations are written in C.


one thing thats nice about java is it has a formal specification.  so in
creating
alternative implementations they can be certified against the spec by sun.
i
think thats another big plus of java.


 they are high level, and although php allows you to write proceedrual
  code, i think it is best used from an oop paradigm.

 This would be a personal choice. Just like C++ allows you to write
 procedural code there are times when OOP makes sense and times when
 procedural is better. It's a choice that should be left up to the
 developer, and the argument over whether OOP is better than procedural
 is not winnable. It's in the same league as PHP vs Python.


unfortunately im a bit rusty w/ my c++; but looking a java the only way to
write
procedural code is to place it in a method called main inside of a class.
does that
count as procedural or does it count as oop ??
when i say oop paradigm i refer to the overall design of an application, or
framework.
said app consists largely of objects; each w/ a focused purpose, the methods
of
which are also small and have a focused purpose.
*sigh*  i dont care to get into this debate again.  in my mind its clear oop
is superior to
strictly procedural programming, but alas you are probably right.  so whats
the use in
arguing ..?

-nathan


Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-26 Thread Stut

Nathan Nobbe wrote:

look at C++, Java, and PHP.  these languages are all written in C;


Just wanted to pick you up on this. PHP is the only language you've 
listed that only has a single implementation. There are implementations 
of C++ compilers that are writting in other languages. I can't speak for 
Java since I have little experience but I'd be surprised if all 
implementations are written in C.


PHP could easily (although lengthily) be re-implemented in another 
language, including PHP itself if you were sufficiently mad.



they are high level, and although php allows you to write proceedrual
code, i think it is best used from an oop paradigm.


This would be a personal choice. Just like C++ allows you to write 
procedural code there are times when OOP makes sense and times when 
procedural is better. It's a choice that should be left up to the 
developer, and the argument over whether OOP is better than procedural 
is not winnable. It's in the same league as PHP vs Python.


-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-26 Thread Richard Lynch
On Fri, August 24, 2007 10:11 am, Steve Brown wrote:

 html
 head
   titlePHP Web Server Test/title
 /head
 body
 ?php phpinfo(); ?
 /body
 /html

phpinfo(), which should never be called in a production setting, is
quite possibly the worst benchmark function you could choose. :-) :-)
:-)

 I ran ab in a loop 12 times with 10,000 connections and a concurrency
 of 10. Then I threw out the highest result and the lowest result and
 averaged the remaining values.   Both PHP4 (v 4.4.7) and PHP5 (v
 5.2.3) were built as Apache modules, and I simply changed Apache's
 config file to swap modules.

 The results were somewhat surprising to me: on average, PHP4
 significantly outperformed PHP5. Over our LAN PHP5 handled roughly
 1,200 requests / sec while PHP4 handled over 1,800 requests / sec.
 Since everything I have heard/read is that PHP5 is much faster than
 PHP4, I expected the opposite to be true, but the numbers are what
 they are.  Also PHP on Apache1 was much faster than on Apache2.

 The only difference I can figure is that PHP5 was the packaged version
 that comes with Ubuntu and I had to compile PHP4 from source since
 there is no package for it in Feisty. But I wouldn't expect a 50%
 increase as a result of that.  Any thoughts on this?

Which PHP on Apache1 vs Apache2 did you try?

PHP5 is probably faster for OOP code more than anything, as that's
where most of the development work went.

Well, that and some good XML processing.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-26 Thread Richard Lynch
On Sat, August 25, 2007 9:45 am, Robert Cummings wrote:
 PHP4 AND PHP5 developers don't even use OOP. Tell me what is
 compelling
 in PHP5 that doesn't rely on you being an OOP developer?

The XML stuff, if you need to parse XML a lot, which is not exactly a
niche market, but not everybody needs it either.

That said:

PHP 4 end of shelf life is just that.

It's software that you're simply going to see less and less of as
fewer and fewer hosts/distros use it.

If you analyze the situation more carefully, I think you'll find that
the statistics about PHP 4 versus PHP 5 adoption are pretty skewed by
large-scale webhosts that are offering PHP 5 now, but aren't pushing
their clients to move to a new box with PHP 5, nor upgrading to PHP 5
on the box they are using.

Will they start pushing their clients or upgrading PHP out from under
them?

Probably some of both.

Will PHP 4 suddenly disappear from the face of the Earth in December?

Or course not.

Should you jump through hoops to write new code that works in both 4
and 5?

Probably not, as PHP 5 is readily available to anybody.

Should your old code that runs on 4 be made to run on 5?

Maybe not today, or even tomorrow, but unless you want to co-lo your
own box with software for which even Security updates aren't available
after Aug 8, 2008 (I think that's the date), then, yeah, you probably
should re-write any code that won't run on 5.  Of which there probably
won't be very much at all.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-26 Thread Richard Lynch
On Sat, August 25, 2007 11:56 am, Nathan Nobbe wrote:
 so we would really have to
 dig deeper for a definition of 'basic oop' / 'true oop' etc.

I'll consider PHP true OOP when PECL has a Lisp extension for me to
write REAL oop code
:-)

Actually, that could be a kind of fun extension to write...

Does anybody else here remember the days of old when PHP 4 OOP was
real OOP and PHP 3 OOP was just glorified structs with functions
attached?

Ah, the joys of sitting through endless silly threads on PHP-General. 
I'm so glad we don't have those anymore...
:-)

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Nathan Nobbe
i dont know Robert; i think it depends upon the structure of ones business.
for instance; i work for a company full time, and have a start up of my own.
in both of those situations there is no impact on the client in the act of
eliminating php4 from the product implementation.  the clients never use the
code directly.  perhaps you are in some different business??

also, there are many, many enhancements to php5 that php4 does not have.
most notably the oop facilities.  but also, exception handling; re-written
XML
infrastructure (SimpleXML, DOM) and a host of new functions not found in 4.
also, the __autoload feature, and even external tools such as SPL make php5
far superior to php4, imho :)

if its a little slower, i dont really care; ill be using optimization
techniques and
have them mastered w/in the next few months so any innate speed difference
will become negligible in my projects.

i probly shouldnt use the word idiot and php4 in conjunction, to reflect my
feelings
because i might actaullly offend some people on the list :)

-nathan

On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Sat, 2007-08-25 at 00:28 -0500, Larry Garfield wrote:
  On Friday 24 August 2007, Lester Caine wrote:
What would be interesting is if a group picked up PHP4 and kept
 going
with it in spite of the end of life announcement a few weeks
 back.  I
wonder if the PHP license would allow such a thing.  How open is it
exactly?
  
   The PROBLEM is that supporting PHP4, 5 and now 6 is detracting from
 solving
   some of these problems. Until we can get away from HAVING to support
 PHP4,
   then PHP5 will not get the full fine tuning it needs. Proposing to
 maintain
   a branch of PHP4 will then result n people expecting all of the major
   frameworks to work on it - and WE need to be able to concentrate on
 USING
   PHP5 properly rather than having to bodge things still to be backwards
   compatible with PHP4 :(
 
  The major frameworks have already agreed that PHP 4 is dead, even
 before the
  PHP dev team did.
 
  http://gophp5.org/

 *yawn*

  Anyone expecting anything but a custom in-house application to continue
 to
  work in PHP 4 by next year is simply not paying attention.  Let it rest
 in
  peace.

 I think many applications will continue to work in PHP4 regardless of
 the gophp5 project. It's not very hard to make applications work in both
 PHP4 and PHP5. I would argue that only an idiot needlessly cuts off more
 than half of their clientele. Elimination of PHP4 updates doesn't mean
 suddenly 100% of the PHP install base becomes PHP5.

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Robert Cummings
On Sat, 2007-08-25 at 09:38 -0400, Nathan Nobbe wrote:
 i dont know Robert; i think it depends upon the structure of ones
 business.
 for instance; i work for a company full time, and have a start up of
 my own.
 in both of those situations there is no impact on the client in the
 act of 
 eliminating php4 from the product implementation.  the clients never
 use the
 code directly.  perhaps you are in some different business??

Larry used the words anything but custom in-house, so you particular
situation is exactly that your particular situation. There will be
countless non-custom-in-house applications that will continue being
compatible with PHP4 just because it's easy.

 also, there are many, many enhancements to php5 that php4 does not
 have. 
 most notably the oop facilities.  but also, exception handling;
 re-written XML
 infrastructure (SimpleXML, DOM) and a host of new functions not found
 in 4.
 also, the __autoload feature, and even external tools such as SPL make
 php5 
 far superior to php4, imho :)

Says who? Says you and myriad of others that sell sugar and hype. Just
because there's a big fat tasty dolop of icing on the cake doesn't mean
you have to eat it. It's the cake that makes the cake, icing is just
extra.

 if its a little slower, i dont really care; ill be using optimization
 techniques and
 have them mastered w/in the next few months so any innate speed
 difference
 will become negligible in my projects. 

Optimization here isn't the issue. Neither was features. Unless you
abolsutely must use a PHP 5 only feature, why limit yourself to PHP5?
I've yet to find myself absolutely needing a PHP5 feature and yet my
apps work both in PHP4 and PHP5. *shrug* I really don't care what you
do, or what Larry does, I'm just saying that just because the gophp5
group says php5 is the shit, doesn't mean everyone will jump on their
bandwagon and suddenly ignore PHP4.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Nathan Nobbe
yes, i agree, people wont be all-of-a-sudden ignoring php4, but the
notice on php.net says to migrate apps to 5 through the rest of the yaer.
id say thats ample time to move away from it.

pretty much all of my applications rely on php5 features except those
where the system was running on php4 when i arrived.  and then i
have to rely upon contriving mechanisms that are already integrated into 5.
plus i place comments where i could be placing keywords.  the success
of an application using objects in php4 relies heavily on communitcdation
w/in the team, whereas w/ php5 the communication can occur w/in the code
using keywords.

im sure php4 applications can be very robust, but why bother rewriting
things
that are available at the language level as they are in 5; and praying that
someone doesnt call a method because they didnt bother to read the
comments..

-nathan

On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Sat, 2007-08-25 at 09:38 -0400, Nathan Nobbe wrote:
  i dont know Robert; i think it depends upon the structure of ones
  business.
  for instance; i work for a company full time, and have a start up of
  my own.
  in both of those situations there is no impact on the client in the
  act of
  eliminating php4 from the product implementation.  the clients never
  use the
  code directly.  perhaps you are in some different business??

 Larry used the words anything but custom in-house, so you particular
 situation is exactly that your particular situation. There will be
 countless non-custom-in-house applications that will continue being
 compatible with PHP4 just because it's easy.

  also, there are many, many enhancements to php5 that php4 does not
  have.
  most notably the oop facilities.  but also, exception handling;
  re-written XML
  infrastructure (SimpleXML, DOM) and a host of new functions not found
  in 4.
  also, the __autoload feature, and even external tools such as SPL make
  php5
  far superior to php4, imho :)

 Says who? Says you and myriad of others that sell sugar and hype. Just
 because there's a big fat tasty dolop of icing on the cake doesn't mean
 you have to eat it. It's the cake that makes the cake, icing is just
 extra.

  if its a little slower, i dont really care; ill be using optimization
  techniques and
  have them mastered w/in the next few months so any innate speed
  difference
  will become negligible in my projects.

 Optimization here isn't the issue. Neither was features. Unless you
 abolsutely must use a PHP 5 only feature, why limit yourself to PHP5?
 I've yet to find myself absolutely needing a PHP5 feature and yet my
 apps work both in PHP4 and PHP5. *shrug* I really don't care what you
 do, or what Larry does, I'm just saying that just because the gophp5
 group says php5 is the shit, doesn't mean everyone will jump on their
 bandwagon and suddenly ignore PHP4.

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Robert Cummings
On Sat, 2007-08-25 at 10:33 -0400, Nathan Nobbe wrote:
 yes, i agree, people wont be all-of-a-sudden ignoring php4, but the
 notice on php.net says to migrate apps to 5 through the rest of the
 yaer. id say thats ample time to move away from it. 

Migrate doesn't necessarily mean ditching PHP4 compatibility. It means
ensuring you are PHP5 compatible. That's reasonable.

 pretty much all of my applications rely on php5 features except those
 where the system was running on php4 when i arrived.  and then i
 have to rely upon contriving mechanisms that are already integrated
 into 5. 
 plus i place comments where i could be placing keywords.  the success
 of an application using objects in php4 relies heavily on
 communitcdation
 w/in the team, whereas w/ php5 the communication can occur w/in the
 code 
 using keywords.
 
 im sure php4 applications can be very robust, but why bother rewriting
 things
 that are available at the language level as they are in 5; and praying
 that
 someone doesnt call a method because they didnt bother to read the
 comments..

Rewriting? You're assuming developers of PHP4 are using all of the
features in PHP5 but written using PHP4 code. That's not a very valid
assumption. You're also assuming they didn't already have code written
in PHP4 that was then duplicated b internal code in PHP5. Hell, many
PHP4 AND PHP5 developers don't even use OOP. Tell me what is compelling
in PHP5 that doesn't rely on you being an OOP developer? Exceptions
don't count since that's an individual bent. C has no exceptions and it
gets on fine (PHP is written in it :)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Nathan Nobbe
Robert,

C is a low-level language whereas php is a high level language.
ill admit it openly, i am biased toward oop / design patterns.
and i think what i boils down to is what you view as 'icing'
i view as 'bread-and-butter' ;)

personally i shudder when i see a big pile of usntructured code, or
a bunch of functions that are loosly organized, if at all.  this constitues
most php applications i have seen in the industry of which i have
been participating for roughly 3 yaers now.

look at C++, Java, and PHP.  these languages are all written in C;
they are high level, and although php allows you to write proceedrual
code, i think it is best used from an oop paradigm.

-nathan

On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Sat, 2007-08-25 at 10:33 -0400, Nathan Nobbe wrote:
  yes, i agree, people wont be all-of-a-sudden ignoring php4, but the
  notice on php.net says to migrate apps to 5 through the rest of the
  yaer. id say thats ample time to move away from it.

 Migrate doesn't necessarily mean ditching PHP4 compatibility. It means
 ensuring you are PHP5 compatible. That's reasonable.

  pretty much all of my applications rely on php5 features except those
  where the system was running on php4 when i arrived.  and then i
  have to rely upon contriving mechanisms that are already integrated
  into 5.
  plus i place comments where i could be placing keywords.  the success
  of an application using objects in php4 relies heavily on
  communitcdation
  w/in the team, whereas w/ php5 the communication can occur w/in the
  code
  using keywords.
 
  im sure php4 applications can be very robust, but why bother rewriting
  things
  that are available at the language level as they are in 5; and praying
  that
  someone doesnt call a method because they didnt bother to read the
  comments..

 Rewriting? You're assuming developers of PHP4 are using all of the
 features in PHP5 but written using PHP4 code. That's not a very valid
 assumption. You're also assuming they didn't already have code written
 in PHP4 that was then duplicated b internal code in PHP5. Hell, many
 PHP4 AND PHP5 developers don't even use OOP. Tell me what is compelling
 in PHP5 that doesn't rely on you being an OOP developer? Exceptions
 don't count since that's an individual bent. C has no exceptions and it
 gets on fine (PHP is written in it :)

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Robert Cummings
On Sat, 2007-08-25 at 10:57 -0400, Nathan Nobbe wrote:
 Robert,
 
 C is a low-level language whereas php is a high level language.
 ill admit it openly, i am biased toward oop / design patterns.
 and i think what i boils down to is what you view as 'icing'
 i view as 'bread-and-butter' ;)

I've pulled Larry out of the CC list BTW :)

I also prefer OOP when developing in PHP.

 personally i shudder when i see a big pile of usntructured code, or
 a bunch of functions that are loosly organized, if at all.  this constitues
 most php applications i have seen in the industry of which i have
 been participating for roughly 3 yaers now.

Oh I'd have to agree. Many things I've downloaded and looked at make me
want to gag. But, that's not a symptom of procedural code-- it's a
symptom of poor coding design/skill/style/ethic.

 look at C++, Java, and PHP.  these languages are all written in C;
 they are high level, and although php allows you to write proceedrual
 code, i think it is best used from an oop paradigm.

That really depends. Just because we prefer to code in OOP in PHP, does
not in anyway discount the merit of well written non OOP PHP code.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Nathan Nobbe
agreed :)

On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Sat, 2007-08-25 at 10:57 -0400, Nathan Nobbe wrote:
  Robert,
 
  C is a low-level language whereas php is a high level language.
  ill admit it openly, i am biased toward oop / design patterns.
  and i think what i boils down to is what you view as 'icing'
  i view as 'bread-and-butter' ;)

 I've pulled Larry out of the CC list BTW :)

 I also prefer OOP when developing in PHP.

  personally i shudder when i see a big pile of usntructured code, or
  a bunch of functions that are loosly organized, if at all.  this
 constitues
  most php applications i have seen in the industry of which i have
  been participating for roughly 3 yaers now.

 Oh I'd have to agree. Many things I've downloaded and looked at make me
 want to gag. But, that's not a symptom of procedural code-- it's a
 symptom of poor coding design/skill/style/ethic.

  look at C++, Java, and PHP.  these languages are all written in C;
  they are high level, and although php allows you to write proceedrual
  code, i think it is best used from an oop paradigm.

 That really depends. Just because we prefer to code in OOP in PHP, does
 not in anyway discount the merit of well written non OOP PHP code.

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Larry Garfield
On Saturday 25 August 2007, Robert Cummings wrote:

 Rewriting? You're assuming developers of PHP4 are using all of the
 features in PHP5 but written using PHP4 code. That's not a very valid
 assumption. You're also assuming they didn't already have code written
 in PHP4 that was then duplicated b internal code in PHP5. Hell, many
 PHP4 AND PHP5 developers don't even use OOP. Tell me what is compelling
 in PHP5 that doesn't rely on you being an OOP developer? Exceptions
 don't count since that's an individual bent. C has no exceptions and it
 gets on fine (PHP is written in it :)

 Cheers,
 Rob.

There is no way to respond to the above request, because you're automatically 
discounting features as an individual bent.  That makes your position 
non-falsifiable (cannot be proven or disproven), and therefore irrelevant.

What does PHP 5 offer?

- Exceptions.  No you don't have to use them, but they are a useful tool.

- Real OOP.  No, you don't have to use it, but it is a useful tool.

- Prepared statements in MySQL (mysqli) or cross-database (PDO).  You really 
should be using them!

- filter extension.  No you don't have to use it, but it's a useful tool for 
security.

- SPL.  You can leverage SPL without having a fully-OOP architecture.  In 
fact, I find it most useful to be able to have my procedural cake and OOP 
icing, too.  No, you don't have to use it, but it's a useful tool.

- SimpleXML and the DOM extension.  XML handling that doesn't suck ass.  No 
you don't have to use them, but if you're doing anything with XML processing 
you will thank the gods that you did.

- A few dozen new utility functions.  Sure they could be/have been 
reimplemented in PHP 4 user-space, but they're not as fast as when 
implemented in C.

That's just off the top of my head.  PHP 5 offers a ton of extra tools that 
can be useful in many situations.  

If you're on a PHP 4 server, you have no choice but to not use them.  

If you're on a PHP 5 server, you can pick and choose which to use based on 
your use case and preferences.

The GoPHP5 project is not about forcing people to use OOP.  It's about 
ensuring that developers have a full tool box available to them when writing 
code.  If you're still using PHP 4 now, then your tool box is only half-full.  
Get on PHP 5 to get the other half.  

The other factor is that those writing code that goes on servers they don't 
have absolute control over (I dare say most of us) are bound by *others'* 
refusal to upgrade to PHP 5.  If I'm on a shared host, I'm stuck with 
whatever that host is running, even if it's ancient.

Supporting PHP 4 hurts PHP 5 developers.  Supporting PHP 5 does not hurt PHP 4 
developers.  That's the problem.

For more info:

http://gophp5.org/faq

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Robert Cummings
On Sat, 2007-08-25 at 11:09 -0500, Larry Garfield wrote:
 On Saturday 25 August 2007, Robert Cummings wrote:
 
  Rewriting? You're assuming developers of PHP4 are using all of the
  features in PHP5 but written using PHP4 code. That's not a very valid
  assumption. You're also assuming they didn't already have code written
  in PHP4 that was then duplicated b internal code in PHP5. Hell, many
  PHP4 AND PHP5 developers don't even use OOP. Tell me what is compelling
  in PHP5 that doesn't rely on you being an OOP developer? Exceptions
  don't count since that's an individual bent. C has no exceptions and it
  gets on fine (PHP is written in it :)
 
  Cheers,
  Rob.
 
 There is no way to respond to the above request, because you're automatically 
 discounting features as an individual bent.  That makes your position 
 non-falsifiable (cannot be proven or disproven), and therefore irrelevant.

I'm indicating that features should not be the sole basis of the
argument since they are indeed an individual bent. As such it helps to
focus the argument to what is important-- the efficacy of PHP4 versus
the efficacy of PHP5. Thus my position is open to falsifiability and not
as you say irrelevant. 

 What does PHP 5 offer?
 
 - Exceptions.  No you don't have to use them, but they are a useful tool.

 - Real OOP.  No, you don't have to use it, but it is a useful tool.

Ooh, the magical Real OOP. Please go find me a definition
of Real OOP. PHP4 is as real OOP as any other OOP. Just because it
lacks some devices available in other OOP implementation does not
disqualify it in any way from being OOP.

 - Prepared statements in MySQL (mysqli) or cross-database (PDO).  You really 
 should be using them!

There are pros and cons to prepared statements:

Sometimes prepared statements can actually be slower than regular
queries. The reason for this is that there are two round-trips to the
server, which can slow down simple queries that are only executed a
single time. In cases like that, one has to decide if it is worth
trading off the performance impact of this extra round-trip in order to
gain the security benefits of using prepared statements.

Any conscious developer can properly escape their queries to be secure.
While PDO offers access to features that are not common to all DBs it
does so in a non-portable way as would be expected. As such it's just
another database abstraction layer. It's quite simple to write wrap this
in a pre-existing PHP encoded database abstraction layer.

 - filter extension.  No you don't have to use it, but it's a useful tool for 
 security.

Sure, but you can filter your variables for security without it.

 - SPL.  You can leverage SPL without having a fully-OOP architecture.  In 
 fact, I find it most useful to be able to have my procedural cake and OOP 
 icing, too.  No, you don't have to use it, but it's a useful tool.

But it doesn't offer much to a fully procedural architecture.

 - SimpleXML and the DOM extension.  XML handling that doesn't suck ass.  No 
 you don't have to use them, but if you're doing anything with XML processing 
 you will thank the gods that you did.

I already have an XML API that works fine in PHP4.

 - A few dozen new utility functions.  Sure they could be/have been 
 reimplemented in PHP 4 user-space, but they're not as fast as when 
 implemented in C.

True, but that's a compatibility / performance tradeoff. And there
doesn't need to be a tradeoff. You can test for PHP4 and include the PHP
versions if PHP4 is active. Otherwise default to PHP5 C implementations.

 That's just off the top of my head.  PHP 5 offers a ton of extra tools that 
 can be useful in many situations.

Sure it offers a ton of extra tools, but there may be a ton of libraries
abandoned that haven't been made compatible with PHP5. Although I must
admit it's quite easy to make code PHP5 compatible.

 If you're on a PHP 4 server, you have no choice but to not use them.  
 
 If you're on a PHP 5 server, you can pick and choose which to use based on 
 your use case and preferences.
 
 The GoPHP5 project is not about forcing people to use OOP.  It's about 
 ensuring that developers have a full tool box available to them when writing 
 code.  If you're still using PHP 4 now, then your tool box is only half-full. 
  
 Get on PHP 5 to get the other half.

I never said gophp5 was about forcing the use of OOP. It just strikes me
as an unnecessary push when market forces will perform the appropriate
pushing at the appropriate time. GOPHP5 is an artifical push for a
faster move towards an inevitable future.

 The other factor is that those writing code that goes on servers they don't 
 have absolute control over (I dare say most of us) are bound by *others'* 
 refusal to upgrade to PHP 5.  If I'm on a shared host, I'm stuck with 
 whatever that host is running, even if it's ancient.

I've nothing against running your stuff in PHP5, nothing against it at
all. But I don't see what the 

Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Nathan Nobbe
i know this thread started off about a performance comparison, but it is
already grown into much more.
suffice it to say that i consider the oop capacity of php4 nothing more than
a stepping stone on the way
to php5.  i dont know of all the oop languages out there.  mostly i have
worked w/ c++ and java
(and a little .net and a tiny bit of delphi) when it comes to oop.
all of those languages have ppp; which i consider to be fundamental to an
oop language; but alas
php is not an oop language; it merely supporst features of an oop language.
 per statements on php.net.

then again javascript is supposedly oop, and i know it doesnt support ppp;
so we would really have to
dig deeper for a definition of 'basic oop' / 'true oop' etc.

from a personal standpoint i have been leraning how to leverage the power of
the interface construct
for 1.  on top of that, well i think no ppp is madness... but again, thats
nothing formal :)

-nathan

On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Sat, 2007-08-25 at 11:09 -0500, Larry Garfield wrote:
  On Saturday 25 August 2007, Robert Cummings wrote:
 
   Rewriting? You're assuming developers of PHP4 are using all of the
   features in PHP5 but written using PHP4 code. That's not a very valid
   assumption. You're also assuming they didn't already have code written
   in PHP4 that was then duplicated b internal code in PHP5. Hell, many
   PHP4 AND PHP5 developers don't even use OOP. Tell me what is
 compelling
   in PHP5 that doesn't rely on you being an OOP developer? Exceptions
   don't count since that's an individual bent. C has no exceptions and
 it
   gets on fine (PHP is written in it :)
  
   Cheers,
   Rob.
 
  There is no way to respond to the above request, because you're
 automatically
  discounting features as an individual bent.  That makes your position
  non-falsifiable (cannot be proven or disproven), and therefore
 irrelevant.

 I'm indicating that features should not be the sole basis of the
 argument since they are indeed an individual bent. As such it helps to
 focus the argument to what is important-- the efficacy of PHP4 versus
 the efficacy of PHP5. Thus my position is open to falsifiability and not
 as you say irrelevant.

  What does PHP 5 offer?
 
  - Exceptions.  No you don't have to use them, but they are a useful
 tool.
 
  - Real OOP.  No, you don't have to use it, but it is a useful tool.

 Ooh, the magical Real OOP. Please go find me a definition
 of Real OOP. PHP4 is as real OOP as any other OOP. Just because it
 lacks some devices available in other OOP implementation does not
 disqualify it in any way from being OOP.

  - Prepared statements in MySQL (mysqli) or cross-database (PDO).  You
 really
  should be using them!

 There are pros and cons to prepared statements:

 Sometimes prepared statements can actually be slower than regular
 queries. The reason for this is that there are two round-trips to the
 server, which can slow down simple queries that are only executed a
 single time. In cases like that, one has to decide if it is worth
 trading off the performance impact of this extra round-trip in order to
 gain the security benefits of using prepared statements.

 Any conscious developer can properly escape their queries to be secure.
 While PDO offers access to features that are not common to all DBs it
 does so in a non-portable way as would be expected. As such it's just
 another database abstraction layer. It's quite simple to write wrap this
 in a pre-existing PHP encoded database abstraction layer.

  - filter extension.  No you don't have to use it, but it's a useful tool
 for
  security.

 Sure, but you can filter your variables for security without it.

  - SPL.  You can leverage SPL without having a fully-OOP
 architecture.  In
  fact, I find it most useful to be able to have my procedural cake and
 OOP
  icing, too.  No, you don't have to use it, but it's a useful tool.

 But it doesn't offer much to a fully procedural architecture.

  - SimpleXML and the DOM extension.  XML handling that doesn't suck
 ass.  No
  you don't have to use them, but if you're doing anything with XML
 processing
  you will thank the gods that you did.

 I already have an XML API that works fine in PHP4.

  - A few dozen new utility functions.  Sure they could be/have been
  reimplemented in PHP 4 user-space, but they're not as fast as when
  implemented in C.

 True, but that's a compatibility / performance tradeoff. And there
 doesn't need to be a tradeoff. You can test for PHP4 and include the PHP
 versions if PHP4 is active. Otherwise default to PHP5 C implementations.

  That's just off the top of my head.  PHP 5 offers a ton of extra tools
 that
  can be useful in many situations.

 Sure it offers a ton of extra tools, but there may be a ton of libraries
 abandoned that haven't been made compatible with PHP5. Although I must
 admit it's quite easy to make code PHP5 compatible.

  If you're on a PHP 4 server, you have 

Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Larry Garfield
Robert and everyone: PLEASE do not reply to list AND the sender, at least not 
when I'm the sender.  I don't need double copies of every message in every 
thread I participate in.  Thanks.

On Saturday 25 August 2007, Robert Cummings wrote:

  There is no way to respond to the above request, because you're
  automatically discounting features as an individual bent.  That makes
  your position non-falsifiable (cannot be proven or disproven), and
  therefore irrelevant.

 I'm indicating that features should not be the sole basis of the
 argument since they are indeed an individual bent. As such it helps to
 focus the argument to what is important-- the efficacy of PHP4 versus
 the efficacy of PHP5. Thus my position is open to falsifiability and not
 as you say irrelevant.

  What does PHP 5 offer?
 
  - Exceptions.  No you don't have to use them, but they are a useful tool.
 
  - Real OOP.  No, you don't have to use it, but it is a useful tool.

 Ooh, the magical Real OOP. Please go find me a definition
 of Real OOP. PHP4 is as real OOP as any other OOP. Just because it
 lacks some devices available in other OOP implementation does not
 disqualify it in any way from being OOP.

  - Prepared statements in MySQL (mysqli) or cross-database (PDO).  You
  really should be using them!

 There are pros and cons to prepared statements:

Sure there are.  But if all you have is the mysql_ extension, you don't get to 
make that choice.  

  - filter extension.  No you don't have to use it, but it's a useful tool
  for security.

 Sure, but you can filter your variables for security without it.

Sure you can.  You could do it in C, too, and then you don't need PHP's 
overhead.  The you can accomplish it without this tool argument carries no 
weight since the whole point of the tool is but I can accomplish it in far 
less time with less code and fewer bugs with it.  

You can build a house using nothing but a hand saw, but a buzz saw makes it oh 
so much easier. :-)

  - SPL.  You can leverage SPL without having a fully-OOP architecture.  In
  fact, I find it most useful to be able to have my procedural cake and
  OOP icing, too.  No, you don't have to use it, but it's a useful tool.

 But it doesn't offer much to a fully procedural architecture.

Have you tried it?

  - SimpleXML and the DOM extension.  XML handling that doesn't suck ass. 
  No you don't have to use them, but if you're doing anything with XML
  processing you will thank the gods that you did.

 I already have an XML API that works fine in PHP4.

There's only a narrow sliver of use cases where I'd say PHP 4's primitive SAX 
parser works fine.  Perhaps you're only working in those, but if you're 
doing anything more complex then the extra tools make life a hell of a lot 
easier.

  - A few dozen new utility functions.  Sure they could be/have been
  reimplemented in PHP 4 user-space, but they're not as fast as when
  implemented in C.

 True, but that's a compatibility / performance tradeoff. And there
 doesn't need to be a tradeoff. You can test for PHP4 and include the PHP
 versions if PHP4 is active. Otherwise default to PHP5 C implementations.

You have to be careful how you structure the code, though.  Conditional 
function definitions still get compiled even if they aren't defined, so 
there's no memory savings.

  The GoPHP5 project is not about forcing people to use OOP.  It's about
  ensuring that developers have a full tool box available to them when
  writing code.  If you're still using PHP 4 now, then your tool box is
  only half-full. Get on PHP 5 to get the other half.

 I never said gophp5 was about forcing the use of OOP. It just strikes me
 as an unnecessary push when market forces will perform the appropriate
 pushing at the appropriate time. GOPHP5 is an artifical push for a
 faster move towards an inevitable future.

GoPHP5 *is that market force*.  It's developers saying OK, we're sick of PHP 
4, it's time for PHP 5, get with the program.  Hosts that don't keep up, 
well, that's capitalism.  It's well past the appropriate time.  

And actually, what I've found from GoPHP5 is that the Nexen stats showing 20% 
PHP 5 deployment on a good day are bunk.  There's no shortage of PHP 5 
compatible hosts, including the big names.  We've been holding ourselves back 
needlessly.

  The other factor is that those writing code that goes on servers they
  don't have absolute control over (I dare say most of us) are bound by
  *others'* refusal to upgrade to PHP 5.  If I'm on a shared host, I'm
  stuck with whatever that host is running, even if it's ancient.

 I've nothing against running your stuff in PHP5, nothing against it at
 all. But I don't see what the problem is with maintaining PHP4
 compatibility while enjoying PHP5 if you so choose to use PHP5.

Because it is not possible to use SimpleXML or SPL or PDO etc. while 
maintaining PHP 4 compatibility, unless you write two completely separate 
implementations with a common 

Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Robert Cummings
On Sat, 2007-08-25 at 12:28 -0500, Larry Garfield wrote:
 Robert and everyone: PLEASE do not reply to list AND the sender, at least not 
 when I'm the sender.  I don't need double copies of every message in every 
 thread I participate in.  Thanks.

Sorry I've been hitting reply-all since I first used email in '93. I
have my doubts I can seriously change my habits now. I've done so this
one time just for you though :)


 On Saturday 25 August 2007, Robert Cummings wrote:


 Sure you can.  You could do it in C, too, and then you don't need PHP's 
 overhead.  The you can accomplish it without this tool argument carries no 
 weight since the whole point of the tool is but I can accomplish it in far 
 less time with less code and fewer bugs with it.  
 
 You can build a house using nothing but a hand saw, but a buzz saw makes it 
 oh 
 so much easier. :-)

PHP4 is the buzz saw. PHP5 is the buzz saw with some extras.

   - SPL.  You can leverage SPL without having a fully-OOP architecture.  In
   fact, I find it most useful to be able to have my procedural cake and
   OOP icing, too.  No, you don't have to use it, but it's a useful tool.
 
  But it doesn't offer much to a fully procedural architecture.
 
 Have you tried it?

Yes I've tried procedural development. it's fun, can be a bit tedious
passing around arrays, but altogether not bad.

   - SimpleXML and the DOM extension.  XML handling that doesn't suck ass. 
   No you don't have to use them, but if you're doing anything with XML
   processing you will thank the gods that you did.
 
  I already have an XML API that works fine in PHP4.
 
 There's only a narrow sliver of use cases where I'd say PHP 4's primitive SAX 
 parser works fine.  Perhaps you're only working in those, but if you're 
 doing anything more complex then the extra tools make life a hell of a lot 
 easier.

I have a wrapper around the parser. I access fields using a very simple
path string.

$xml-getLiteral( '/response/products/[EMAIL PROTECTED]' );

or

$xml-focus( '/response/products/product' );
$products = $xml-getIndexes();
foreach( $products as $pi )
{
echo 'Status: '.$xml-getLiteral( [EMAIL PROTECTED] );
}

It works very well on very complex XML.

   - A few dozen new utility functions.  Sure they could be/have been
   reimplemented in PHP 4 user-space, but they're not as fast as when
   implemented in C.
 
  True, but that's a compatibility / performance tradeoff. And there
  doesn't need to be a tradeoff. You can test for PHP4 and include the PHP
  versions if PHP4 is active. Otherwise default to PHP5 C implementations.
 
 You have to be careful how you structure the code, though.  Conditional 
 function definitions still get compiled even if they aren't defined, so 
 there's no memory savings.

They don't get compiled if you conditionally include the files that have
them.

   The GoPHP5 project is not about forcing people to use OOP.  It's about
   ensuring that developers have a full tool box available to them when
   writing code.  If you're still using PHP 4 now, then your tool box is
   only half-full. Get on PHP 5 to get the other half.
 
  I never said gophp5 was about forcing the use of OOP. It just strikes me
  as an unnecessary push when market forces will perform the appropriate
  pushing at the appropriate time. GOPHP5 is an artifical push for a
  faster move towards an inevitable future.
 
 GoPHP5 *is that market force*.  It's developers saying OK, we're sick of PHP 
 4, it's time for PHP 5, get with the program.  Hosts that don't keep up, 
 well, that's capitalism.  It's well past the appropriate time.  

No, GoPHP5 is an external force attempting to sway the market. If you
were THE market force then PHP5 would already be the majority version
and GoPHP5 would be moot.

 And actually, what I've found from GoPHP5 is that the Nexen stats showing 20% 
 PHP 5 deployment on a good day are bunk.  There's no shortage of PHP 5 
 compatible hosts, including the big names.  We've been holding ourselves back 
 needlessly.
 
   The other factor is that those writing code that goes on servers they
   don't have absolute control over (I dare say most of us) are bound by
   *others'* refusal to upgrade to PHP 5.  If I'm on a shared host, I'm
   stuck with whatever that host is running, even if it's ancient.
 
  I've nothing against running your stuff in PHP5, nothing against it at
  all. But I don't see what the problem is with maintaining PHP4
  compatibility while enjoying PHP5 if you so choose to use PHP5.
 
 Because it is not possible to use SimpleXML or SPL or PDO etc. while 
 maintaining PHP 4 compatibility, unless you write two completely separate 
 implementations with a common facade.

But if you already have those implementations because you're coming from
PHP4, then who cares. If I already have a huge codebase that uses PHP4
XML semantics then why recode those to use SimpleXML or SPL or PDO when
they already work fine in PHP4? Sure, if 

Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Nathan Nobbe
i dont know what all this goPHP5 stuff is about.
all i know is there was an announcment on php.net a few weeks back saying
php4 is deprecated and it soon will be made obsolete.

-nathan

On 8/25/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Sat, 2007-08-25 at 12:28 -0500, Larry Garfield wrote:
  Robert and everyone: PLEASE do not reply to list AND the sender, at
 least not
  when I'm the sender.  I don't need double copies of every message in
 every
  thread I participate in.  Thanks.

 Sorry I've been hitting reply-all since I first used email in '93. I
 have my doubts I can seriously change my habits now. I've done so this
 one time just for you though :)


  On Saturday 25 August 2007, Robert Cummings wrote:


  Sure you can.  You could do it in C, too, and then you don't need PHP's
  overhead.  The you can accomplish it without this tool argument
 carries no
  weight since the whole point of the tool is but I can accomplish it in
 far
  less time with less code and fewer bugs with it.
 
  You can build a house using nothing but a hand saw, but a buzz saw makes
 it oh
  so much easier. :-)

 PHP4 is the buzz saw. PHP5 is the buzz saw with some extras.

- SPL.  You can leverage SPL without having a fully-OOP
 architecture.  In
fact, I find it most useful to be able to have my procedural cake
 and
OOP icing, too.  No, you don't have to use it, but it's a useful
 tool.
  
   But it doesn't offer much to a fully procedural architecture.
 
  Have you tried it?

 Yes I've tried procedural development. it's fun, can be a bit tedious
 passing around arrays, but altogether not bad.

- SimpleXML and the DOM extension.  XML handling that doesn't suck
 ass.
No you don't have to use them, but if you're doing anything with XML
processing you will thank the gods that you did.
  
   I already have an XML API that works fine in PHP4.
 
  There's only a narrow sliver of use cases where I'd say PHP 4's
 primitive SAX
  parser works fine.  Perhaps you're only working in those, but if
 you're
  doing anything more complex then the extra tools make life a hell of a
 lot
  easier.

 I have a wrapper around the parser. I access fields using a very simple
 path string.

 $xml-getLiteral( '/response/products/[EMAIL PROTECTED]' );

 or

 $xml-focus( '/response/products/product' );
 $products = $xml-getIndexes();
 foreach( $products as $pi )
 {
 echo 'Status: '.$xml-getLiteral( [EMAIL PROTECTED] );
 }

 It works very well on very complex XML.

- A few dozen new utility functions.  Sure they could be/have been
reimplemented in PHP 4 user-space, but they're not as fast as when
implemented in C.
  
   True, but that's a compatibility / performance tradeoff. And there
   doesn't need to be a tradeoff. You can test for PHP4 and include the
 PHP
   versions if PHP4 is active. Otherwise default to PHP5 C
 implementations.
 
  You have to be careful how you structure the code, though.  Conditional
  function definitions still get compiled even if they aren't defined,
 so
  there's no memory savings.

 They don't get compiled if you conditionally include the files that have
 them.

The GoPHP5 project is not about forcing people to use OOP.  It's
 about
ensuring that developers have a full tool box available to them when
writing code.  If you're still using PHP 4 now, then your tool box
 is
only half-full. Get on PHP 5 to get the other half.
  
   I never said gophp5 was about forcing the use of OOP. It just strikes
 me
   as an unnecessary push when market forces will perform the appropriate
   pushing at the appropriate time. GOPHP5 is an artifical push for a
   faster move towards an inevitable future.
 
  GoPHP5 *is that market force*.  It's developers saying OK, we're sick
 of PHP
  4, it's time for PHP 5, get with the program.  Hosts that don't keep
 up,
  well, that's capitalism.  It's well past the appropriate time.

 No, GoPHP5 is an external force attempting to sway the market. If you
 were THE market force then PHP5 would already be the majority version
 and GoPHP5 would be moot.

  And actually, what I've found from GoPHP5 is that the Nexen stats
 showing 20%
  PHP 5 deployment on a good day are bunk.  There's no shortage of PHP 5
  compatible hosts, including the big names.  We've been holding ourselves
 back
  needlessly.
 
The other factor is that those writing code that goes on servers
 they
don't have absolute control over (I dare say most of us) are bound
 by
*others'* refusal to upgrade to PHP 5.  If I'm on a shared host, I'm
stuck with whatever that host is running, even if it's ancient.
  
   I've nothing against running your stuff in PHP5, nothing against it at
   all. But I don't see what the problem is with maintaining PHP4
   compatibility while enjoying PHP5 if you so choose to use PHP5.
 
  Because it is not possible to use SimpleXML or SPL or PDO etc. while
  maintaining PHP 4 compatibility, unless you 

Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Larry Garfield
On Saturday 25 August 2007, Nathan Nobbe wrote:
 i dont know what all this goPHP5 stuff is about.
 all i know is there was an announcment on php.net a few weeks back saying
 php4 is deprecated and it soon will be made obsolete.

 -nathan

That announcement came a week after this site launched:

http://gophp5.org/

I do not know what if any role it played in the PHP Internals folks' decision 
to EOL PHP 4, but with or without it the bulk of the PHP world is already 
committed to moving to PHP 5.2 anyway.

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-25 Thread Robert Cummings
On Sat, 2007-08-25 at 14:26 -0500, Larry Garfield wrote:
 On Saturday 25 August 2007, Nathan Nobbe wrote:
  i dont know what all this goPHP5 stuff is about.
  all i know is there was an announcment on php.net a few weeks back saying
  php4 is deprecated and it soon will be made obsolete.
 
  -nathan
 
 That announcement came a week after this site launched:
 
 http://gophp5.org/
 
 I do not know what if any role it played in the PHP Internals folks' decision 
 to EOL PHP 4, but with or without it the bulk of the PHP world is already 
 committed to moving to PHP 5.2 anyway.

Maybe it should be GoPHP5.2 ;) I don't think anyone seriously would say
Go anything less that 5.2 since there are so many issues before that.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Steve Brown
Recently, I've been doing a lot of benchmarking with Apache to compare
different OSes and platforms. I did a stock install of Ubuntu 7.04
Server w/ Apache2 and PHP5. To do the test, I used ab to fetch the
following document:

html
head
  titlePHP Web Server Test/title
/head
body
?php phpinfo(); ?
/body
/html

I ran ab in a loop 12 times with 10,000 connections and a concurrency
of 10. Then I threw out the highest result and the lowest result and
averaged the remaining values.   Both PHP4 (v 4.4.7) and PHP5 (v
5.2.3) were built as Apache modules, and I simply changed Apache's
config file to swap modules.

The results were somewhat surprising to me: on average, PHP4
significantly outperformed PHP5. Over our LAN PHP5 handled roughly
1,200 requests / sec while PHP4 handled over 1,800 requests / sec.
Since everything I have heard/read is that PHP5 is much faster than
PHP4, I expected the opposite to be true, but the numbers are what
they are.  Also PHP on Apache1 was much faster than on Apache2.

The only difference I can figure is that PHP5 was the packaged version
that comes with Ubuntu and I had to compile PHP4 from source since
there is no package for it in Feisty. But I wouldn't expect a 50%
increase as a result of that.  Any thoughts on this?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Nathan Nobbe
what are the changes that supposedly make php5 faster than php4?

when java went from the 1.4 series to the 5 series it became much faster.
this is because of enhancements to the jitter mechanism for sure.  i dont
know what else they changed, but i know that had a great impact on the
performance.

php5 passes objects around by reference automatically, whereas in php4
if you do not specifically assign references using the
=
construct a copy will be created.  i suspect if your test included a
scenario
where the = mechanism was not used in php4, it would not be as fast as
the php5 counterpart, simply because more memory would be consumed.
indeed i suspect there is plenty of php4 code where people have forgotten
to assign object references using =.

-nathan

On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:

 Recently, I've been doing a lot of benchmarking with Apache to compare
 different OSes and platforms. I did a stock install of Ubuntu 7.04
 Server w/ Apache2 and PHP5. To do the test, I used ab to fetch the
 following document:

 html
 head
   titlePHP Web Server Test/title
 /head
 body
 ?php phpinfo(); ?
 /body
 /html

 I ran ab in a loop 12 times with 10,000 connections and a concurrency
 of 10. Then I threw out the highest result and the lowest result and
 averaged the remaining values.   Both PHP4 (v 4.4.7) and PHP5 (v
 5.2.3) were built as Apache modules, and I simply changed Apache's
 config file to swap modules.

 The results were somewhat surprising to me: on average, PHP4
 significantly outperformed PHP5. Over our LAN PHP5 handled roughly
 1,200 requests / sec while PHP4 handled over 1,800 requests / sec.
 Since everything I have heard/read is that PHP5 is much faster than
 PHP4, I expected the opposite to be true, but the numbers are what
 they are.  Also PHP on Apache1 was much faster than on Apache2.

 The only difference I can figure is that PHP5 was the packaged version
 that comes with Ubuntu and I had to compile PHP4 from source since
 there is no package for it in Feisty. But I wouldn't expect a 50%
 increase as a result of that.  Any thoughts on this?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Robert Cummings
PHP5 being faster than PHP4 is greatly dependent on what features you
use. I've consistently found PHP4 to be faster for my purposes also.

Cheers,
Rob.


On Fri, 2007-08-24 at 11:38 -0400, Nathan Nobbe wrote:
 what are the changes that supposedly make php5 faster than php4?
 
 when java went from the 1.4 series to the 5 series it became much faster.
 this is because of enhancements to the jitter mechanism for sure.  i dont
 know what else they changed, but i know that had a great impact on the
 performance.
 
 php5 passes objects around by reference automatically, whereas in php4
 if you do not specifically assign references using the
 =
 construct a copy will be created.  i suspect if your test included a
 scenario
 where the = mechanism was not used in php4, it would not be as fast as
 the php5 counterpart, simply because more memory would be consumed.
 indeed i suspect there is plenty of php4 code where people have forgotten
 to assign object references using =.
 
 -nathan
 
 On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:
 
  Recently, I've been doing a lot of benchmarking with Apache to compare
  different OSes and platforms. I did a stock install of Ubuntu 7.04
  Server w/ Apache2 and PHP5. To do the test, I used ab to fetch the
  following document:
 
  html
  head
titlePHP Web Server Test/title
  /head
  body
  ?php phpinfo(); ?
  /body
  /html
 
  I ran ab in a loop 12 times with 10,000 connections and a concurrency
  of 10. Then I threw out the highest result and the lowest result and
  averaged the remaining values.   Both PHP4 (v 4.4.7) and PHP5 (v
  5.2.3) were built as Apache modules, and I simply changed Apache's
  config file to swap modules.
 
  The results were somewhat surprising to me: on average, PHP4
  significantly outperformed PHP5. Over our LAN PHP5 handled roughly
  1,200 requests / sec while PHP4 handled over 1,800 requests / sec.
  Since everything I have heard/read is that PHP5 is much faster than
  PHP4, I expected the opposite to be true, but the numbers are what
  they are.  Also PHP on Apache1 was much faster than on Apache2.
 
  The only difference I can figure is that PHP5 was the packaged version
  that comes with Ubuntu and I had to compile PHP4 from source since
  there is no package for it in Feisty. But I wouldn't expect a 50%
  increase as a result of that.  Any thoughts on this?
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Greg Donald
On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:
 The only difference I can figure is that PHP5 was the packaged version
 that comes with Ubuntu and I had to compile PHP4 from source since
 there is no package for it in Feisty. But I wouldn't expect a 50%
 increase as a result of that.  Any thoughts on this?

What would be interesting is if a group picked up PHP4 and kept going
with it in spite of the end of life announcement a few weeks back.  I
wonder if the PHP license would allow such a thing.  How open is it
exactly?


-- 
Greg Donald
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Robert Cummings
On Fri, 2007-08-24 at 12:24 -0500, Greg Donald wrote:
 On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:
  The only difference I can figure is that PHP5 was the packaged version
  that comes with Ubuntu and I had to compile PHP4 from source since
  there is no package for it in Feisty. But I wouldn't expect a 50%
  increase as a result of that.  Any thoughts on this?
 
 What would be interesting is if a group picked up PHP4 and kept going
 with it in spite of the end of life announcement a few weeks back.  I
 wonder if the PHP license would allow such a thing.  How open is it
 exactly?

You can fork PHP. You just can't use PHP in the name of your new branch.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Lester Caine

Greg Donald wrote:

On 8/24/07, Steve Brown [EMAIL PROTECTED] wrote:

The only difference I can figure is that PHP5 was the packaged version
that comes with Ubuntu and I had to compile PHP4 from source since
there is no package for it in Feisty. But I wouldn't expect a 50%
increase as a result of that.  Any thoughts on this?


What would be interesting is if a group picked up PHP4 and kept going
with it in spite of the end of life announcement a few weeks back.  I
wonder if the PHP license would allow such a thing.  How open is it
exactly?


The PROBLEM is that supporting PHP4, 5 and now 6 is detracting from solving 
some of these problems. Until we can get away from HAVING to support PHP4, 
then PHP5 will not get the full fine tuning it needs. Proposing to maintain a 
branch of PHP4 will then result n people expecting all of the major frameworks 
to work on it - and WE need to be able to concentrate on USING PHP5 properly 
rather than having to bodge things still to be backwards compatible with PHP4 :(


Steve
Did your test run the SAME modules on each version of PHP. Were the generated 
pages the same size. I thought that by default PHP5 had more features enabled 
so I would expect the phpinfo page to be a lot longer?


--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Larry Garfield
On Friday 24 August 2007, Lester Caine wrote:
  What would be interesting is if a group picked up PHP4 and kept going
  with it in spite of the end of life announcement a few weeks back.  I
  wonder if the PHP license would allow such a thing.  How open is it
  exactly?

 The PROBLEM is that supporting PHP4, 5 and now 6 is detracting from solving
 some of these problems. Until we can get away from HAVING to support PHP4,
 then PHP5 will not get the full fine tuning it needs. Proposing to maintain
 a branch of PHP4 will then result n people expecting all of the major
 frameworks to work on it - and WE need to be able to concentrate on USING
 PHP5 properly rather than having to bodge things still to be backwards
 compatible with PHP4 :(

The major frameworks have already agreed that PHP 4 is dead, even before the 
PHP dev team did.

http://gophp5.org/

Anyone expecting anything but a custom in-house application to continue to 
work in PHP 4 by next year is simply not paying attention.  Let it rest in 
peace.

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Performance?

2007-08-24 Thread Robert Cummings
On Sat, 2007-08-25 at 00:28 -0500, Larry Garfield wrote:
 On Friday 24 August 2007, Lester Caine wrote:
   What would be interesting is if a group picked up PHP4 and kept going
   with it in spite of the end of life announcement a few weeks back.  I
   wonder if the PHP license would allow such a thing.  How open is it
   exactly?
 
  The PROBLEM is that supporting PHP4, 5 and now 6 is detracting from solving
  some of these problems. Until we can get away from HAVING to support PHP4,
  then PHP5 will not get the full fine tuning it needs. Proposing to maintain
  a branch of PHP4 will then result n people expecting all of the major
  frameworks to work on it - and WE need to be able to concentrate on USING
  PHP5 properly rather than having to bodge things still to be backwards
  compatible with PHP4 :(
 
 The major frameworks have already agreed that PHP 4 is dead, even before 
 the 
 PHP dev team did.
 
 http://gophp5.org/

*yawn*

 Anyone expecting anything but a custom in-house application to continue to 
 work in PHP 4 by next year is simply not paying attention.  Let it rest in 
 peace.

I think many applications will continue to work in PHP4 regardless of
the gophp5 project. It's not very hard to make applications work in both
PHP4 and PHP5. I would argue that only an idiot needlessly cuts off more
than half of their clientele. Elimination of PHP4 updates doesn't mean
suddenly 100% of the PHP install base becomes PHP5.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP4 VS PHP5 Performance

2006-02-06 Thread Ray Hauge
Hello all,

I've been poking around a little bit, and I haven't found a good link for 
showing the performance differences between the two versions of PHP.  Mostly 
I was just curious what the numbers were.  I've heard some conflicting 
opinions on the matter, and wanted to clear it up with some facts.  I don't 
have the time to set up php4 and php5 on identical machines :(

Thanks!

--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
1.800.575.1099

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php