On Monday 18 February 2008, Rasmus Lerdorf wrote:
> Larry Garfield wrote:
> > You also note that this mechanism has no runtime impact.  That's
> > unfortunate, because I'd find the ability to add methods to an object at
> > runtime conditionally based on some other value far more useful in my
> > work. :-) Especially since, as above, there seems to be a way to
> > implement this functionality now as-is with a little more typing, yet
> > runtime modification is still impossible without eval() and similar scary
> > stuff.
>
> The idea here is that we want to be able to cache opcodes, classes and
> functions and optimize them out of the runtime context so the executor
> can skip creating classes and functions on every single request.  A lot
> of the traffic on this list over the past couple of months seems to
> ignore this basic premise.  Features such as autoload and runtime object
> manipulation incur a huge performance hit in the sense that they change
> something that was free before and not only add the cost of the feature
> itself, but it also means the object in question now can no longer be
> cached and has to be created on every single request.
>
> This doesn't mean we can't consider such features, but people need to
> also consider the performance implications.
>
> -Rasmus

Indeed, those are a concern.  That's why I thought the closure proposal from 
late December was so promising, because it appeared (to my non-C-coding eyes) 
to not have any runtime compilation, just indirect calling.  

It looks like Traits as described in the original post wouldn't have a runtime 
cost, but might (depending on the cost of building the code references) have 
a notable compile cost.  Runtime would cost more, but could they be done in a 
non-terrible way?  (I don't know; that's why I'm asking.)  Is the lookup 
table for what functions exist within a class/object easy/fast to manipulate 
or slow?

-- 
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 Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to