Hello Stanislav,

Monday, January 19, 2009, 10:12:46 AM, you wrote:

> Hi!

>> Aren't we able to bind these at least partially to the function call
>> opcode, in case we know they are constant? If all is constsnt we could
>> even store the whole lookup in the opcode. Well you'd have to convince
>> Zend to do that because os far they have always been against this
>> approach.

> Err, I'm not sure how can you store in opcode something you don't know - 
> since opcode may be generated well before class or method exists, not 
> speaking about the object of which you know nothing at the time of 
> opcode generation? Same opcode could call entirely different methods of 
> different classes. Am I missing somehing?

Nope. But sometimes we are in a scope where it is always the same thing we
call. Or at leats a one of the three things are constant. And any of them
being constant would help.

>> Also the zend_class_enty lookup in [1c] imo is completely useless. If
>> the zval object would store the class entry and the class entry had a
>> pointer to the handlers then we would save another costly lookup and
>> simply follow a pointer instead.

> having only one handler table per class would make objects less flexible.

How so? Tell me any case where that is different right now?

Right now every member of a class tree (each class derived from a specific
base class) has the same handler table. And that cannot be changed becasue
each of the class members have the same creation/destruction c functions.

The way to change that would be to have several creation functions that
create objects with the same class that have different handlers. While that
works at this level, we would end up in problems where we copy members of
these classes or perform other complex operations. Unfortunately we often
assume that same objects have the same handlers. And last but not least we
already have some code that checks for handlers rather than for classes.
Just because it is faster. My idea would in these cases add one more
pointer indirection but change the other way to simply pointer resolving.
Thus my idea would overall increase PHP speed.

> -- 
> Stanislav Malyshev, Zend Software Architect
> s...@zend.com   http://www.zend.com/
> (408)253-8829   MSN: s...@zend.com




Best regards,
 Marcus


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

Reply via email to