|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Optimizations revived |
Date: | Sun, 24 Aug 2014 16:46:35 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
Hi Elias, I don't know. Actually I just found a nasty example which renders my statement below ("I believe the clone() call in Symbol::resolve() can be skipped completely") wrong: A←10⍴10 A+ (A[3]←3) ⊢ A Currently a value is cloned when it is assigned to a variable and again when the variable is referenced. The above example shows why cloning on reference is needed. You get the correct 20 20 13 20 20 20 20 20 20 20 when you clone and the wrong 20 20 6 20 20 20 20 20 20 20 if not. The problem that I see with CoW is that we know how many owners a value has but not who they are. And you definitely dont want to clone on indexed assignment because very often you have a large value and only a small part being updated. With CoW you dont want to clone the value that is being assigned but rather the other (possibly many copies) and those we don't know. I also don't share your opinion that the cloning is unnecessary. I think it is more so that it is sometimes unnecessary, but at the time when you would not clone you don't have enough information to properly make that decision. /// Jürgen On 08/24/2014 04:04 PM, Elias Mårtenson
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |