Ok...
These benchmarks are (win32)
php-4.1.2 Release_TS_inline (brad) vs php-4.1.2 binary from php.net (php)

i have attached the test scripts that i used. 
(I ran each about 10 times and averaged the times, I used cygwin's time
command)

case one (worse case for php):
brad - .11 sec
php - .45 sec

This is the worse case because php copies all of the functions from the
previous class to the extended class so this script has 100 classes with 10
different functions in each so the 100'th class will have 1000 functions. With
this test i still called a function defined in the base class. Not only is this
way faster the new way it uses less memory.

case two (worse case for brad):
brad - .060 sec
php - .080 sec
This test has 100 declared classes all inheriting each other, only defining a
constructor in each class. Then makes a instance of the 100'th class and calls
a method in the base class 100 times.

brad - .075 sec
php - .090 sec
The same thing as above but it calls the method 1000 times.

brad - .23 sec
php - .14 sec
again with 10000 method calls

As you can tell as the number of method calls go up the time of execution goes
up in the 'brad' version. IMHO doing 10000 calls to a method declared in a base
class of a inheritance chain of 100 classes and only loosing .09 seconds isn't
that bad at all.  Seing this type of path will solve a few problems.

--- Yasuo Ohgaki <[EMAIL PROTECTED]> wrote:
> Brad,
> How about post detailed benchmarks for your patch?
> 
> IMHO. This bug is fatal. Especially those who are
> experienced with other OO languages, such as C++/Java.
> 
> --
> Yasuo Ohgaki
> 
> Brad Lafountain wrote:
> > This bug is eaisly fixable. This is also something that i have been trying
> to
> > push on a couple of threads now. You would need to do 3 things. 
> > 
> > 1) change the compiler so that inherited objects don't copy the opcodes 
> >  of the functions. it will just store the parent's ce.
> > 
> > 2) change the executor so it will execute functions recursivly thru the
> >  parents ce's
> > 
> > ( i was talking about this change on engine2 list andi was arguing that it
> > would be slower on execution of a function. I made the changes and it was
> > faster. See the 'Mulitple Inhertiance' thread on engine2 list. This would
> also
> > allow you to inherit overloaded objects defined in c.. ie Java)
> > 
> > 3) again change the compiler to test only the current ce for re-definitions
> of
> > the defined function. (derick already did this)
> > 
> > So as far as im conserned making this change will solve many problems...
> But im
> > really still confused why andi doesn't want this change. I will send my
> diff if
> > you want.
> > 
> >  - Brad
> > 
> > --- [EMAIL PROTECTED] wrote:
> > 
> >> ID:               16265
> >> Updated by:       [EMAIL PROTECTED]
> >> Reported By:      [EMAIL PROTECTED]
> >>-Status:           Open
> >>+Status:           Suspended
> >> Bug Type:         Scripting Engine problem
> >> Operating System: Linux
> >> PHP Version:      4.1.2
> >> New Comment:
> >>
> >>I'm suspending this for now, this issue is not easily solved
> >>unfortunately. But we keep this on the todo list for future releases.
> >>
> >>Derick
> >>
> >>
> >>Previous Comments:
> >>------------------------------------------------------------------------
> >>
> >>[2002-04-01 21:37:21] [EMAIL PROTECTED]
> >>
> >>Need to open again.
> >>This bug may be suspended.
> >>
> >>------------------------------------------------------------------------
> >>
> >>[2002-03-25 15:32:48] [EMAIL PROTECTED]
> >>
> >>Fixed in CVS, will also be in PHP 4.2.0
> >>
> >>Derick
> >>
> >>------------------------------------------------------------------------
> >>
> >>[2002-03-25 13:12:42] [EMAIL PROTECTED]
> >>
> >>PHP does not report multiply-defined errors for class member functions.
> >>For example, the following script below, when executed, only outputs
> >>"two", with no errors.
> >>
> >>Instead, PHP should be giving error messages since the function bar has
> >>been defined multiple times.
> >>
> >><?
> >>class foo
> >>{
> >>        function bar() {echo "one\n";}
> >>        function bar() {echo "two\n";}
> >>}
> >>
> >>$f = new foo();
> >>$f->bar();
> >>
> >>------------------------------------------------------------------------
> >>
> >>
> >>-- 
> >>Edit this bug report at http://bugs.php.net/?id=16265&edit=1
> >>
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Tax Center - online filing with TurboTax
> > http://http://taxes.yahoo.com/
> 
> 
> 
> -- 
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to