At 06:44 18-12-2002, Moriyoshi Koizumi wrote:

Andi Gutmans <[EMAIL PROTECTED]> wrote:

> At 12:49 AM 12/17/2002 +0900, Moriyoshi Koizumi wrote:
> >Andi Gutmans <[EMAIL PROTECTED]> wrote:
> >
> > > I don't understand what you're doing here. Are you actually separating on
> > > every assignment and doing a deep copy?
> >
> >What I'm trying to do in my patch can be divided into two phases.
> >
> >In the first phase, it checks whether the array contains any referenced
> >elements (of course it does nothing and return SUCCESS if the passed zval
> >is a non-array value).
> >
> >If such an element exists, then entering the second phase, separates the
> >array zval and duplicates each referenced element while it doesn't make
> >copies, but only increments the refcount for non-referenced elements.
>
> OK so that's a deep copy. As much as I understand the motivation I don't
> think this should be done. It'll slow down lots of things in PHP. I think
> this should be solved by documentation.

Yes, according to my trivial benchmark, my patch puts a considerable
weight on the ZendEngine, to run twice as slowly as the current runtime in
the worst case. Seems no way, but I suppose it also sounds a reasonable
penalty of using references.
Actually - the natural 'feeling' with references is speed increases - not slowdowns,
since one expects a 'pointer', rather than a copy.

Is there a way to warn when such a refstatement is detected, without causing slowdowns?

With kind regards,

Melvyn Sopacua
<?php include("not_reflecting_employers_views.txt"); ?>


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



Reply via email to