Hi!

On 2019-01-07, E. Madison Bray <erik.m.b...@gmail.com> wrote:
> On Tue, Dec 18, 2018 at 5:29 PM VulK <etn45...@gmail.com> wrote:
>> Unfortunately this is not the case; this method store its cache *both* in the
>> parent and in the element. Apparently this was done in #8611 for speed
>> reasons. I do not really understand the rationale behind this though. Why do
>> we need to keep two copies of the cache?
>
> Are there really two *separate* caches? Or do the parent and the
> element each just have their own references to the same cache?

Yes, they share the same cache. It's just a second reference to the same
dictionary.

> Either
> way, that does seem like unnecessary overhead, even for "speed
> reasons".

I did the implementation a couple of years ago, so, it is possible that
I misremember. However, if I recall correctly, having a reference
directly from the wrapped method to the cache, rather than going from the
wrapped method to the instance to which the method is bound and finally
to an item of the __dict__ of the instance, had a noticeable effect.

Best regards,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to