Re: parent_ctor()

From: Date: Mon, 17 Jul 2000 16:43:20 +0000
Subject: Re: parent_ctor()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24787@lists.php.net to get a copy of this message
At 18:32 17-07-00, waldschrott wrote:
And why is that, generally speaking OO isn't slower than arrays or the likes, doing some simple testing with multi-dimensional arrays that were indexed like array[parentid][itemid][] contra objectparent containing arr[] of objectitem, found that the OO way took 0.2 secs less when it had to fill out around 100 or so parentids, that's a 25% speed increase done with a rewrite that took 3-4 hours...
If possible, can you send that code to me - I´ve done some testing too on a complete benchmark environment and if noticed a 60-100% performance decrease against array hash version! If a base my understanding of "significant performance difference" on what zeev said (10x times is signifant difference) then OO stuff is *not* significant slower than non-OO code.
Woah. 2x *IS* significant. It's very significant. Especially when you're talking about a development model, which affects every part of your applications. It literally means your web pages will render at half the speed! My statement was about some sort of a rule-of-the-thumb for deciding whether code should be implemented in C, which is more difficult to develop and maintain, plus is more error-prone - or should be left for implementation in PHP. If the gain from using C, which comes in great cost, doesn't give you an order of magnitude of difference, it would be a good idea to stay away from C and implement in PHP. Again, it's a rule of the thumb, and with some functions, which are used repeatedly and very often, hundreds or more times per execution, it would probably make sense to implement them in C. Now, this entire 'rule' applies only to specific functions, not when you're talking about an architecture. If you compare two architectures, and one is 60-100% quicker than the other, it's NOT negligible.
I would rather say it makes big projects impossible (at least to maintain) and as it appears on zend.com PHP4/zend targets big projects...
I don't see how it makes big projects impossible. In fact, I know for a fact it doesn't, because quite huge projects use PHP successfully, and are completely maintainable (and maintained). As I see it, PHP targets big projects, BUT only if it doesn't hurt its much much wider and common audience, of medium and small scale projects.
Destructors.
Perhaps that really is not small thing, zeev mentioned several times that there is no clean way to implement that...
At least someone remembers :) Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#24787) next »