Re: Re: #20993 [Ver]: Elementvaluechangeswithoutasking
| From: | Melvyn Sopacua | Date: | Wed, 18 Dec 2002 09:27:59 +0000 |
| Subject: | Re: Re: #20993 [Ver]: Elementvaluechangeswithoutasking | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-92575@lists.php.net to get a copy of this message | ||
At 06:44 18-12-2002, Moriyoshi Koizumi wrote:
Andi Gutmans <andi@zend.com> wrote: At 12:49 AM 12/17/2002 +0900, Moriyoshi Koizumi wrote: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"); ?>Andi Gutmans <andi@zend.com> wrote:separating onI don't understand what you're doing here. Are you actuallyOK 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.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.