Re: Adding an associated reference is memory expensive (was: Adding an observer is memory expensive)

2009-09-14 Thread Torsten Radtke
Hi Ken and Greg This is a bug in the associated reference machinery. That code keeps a C++ std::hash_map per augmented object, mapping associated keys to associated values. std::hash_map uses an std::vector internally, and the default hash_map constructor pre-allocates 100 entries for that

Re: Adding an associated reference is memory expensive (was: Adding an observer is memory expensive)

2009-09-12 Thread Kai BrĂ¼ning
On 12.9.2009, at 00:35, Greg Parker wrote: We have your earlier report rdar://7212101. Thanks, Torsten. (Ken didn't see it because the bug didn't pass through his group's hands on its way to my group.) This is a bug in the associated reference machinery. That code keeps a C++

Re: Adding an associated reference is memory expensive (was: Adding an observer is memory expensive)

2009-09-12 Thread Greg Parker
On Sep 12, 2009, at 12:59 AM, Kai BrĂ¼ning wrote: On 12.9.2009, at 00:35, Greg Parker wrote: We have your earlier report rdar://7212101. Thanks, Torsten. (Ken didn't see it because the bug didn't pass through his group's hands on its way to my group.) This is a bug in the associated

Adding an associated reference is memory expensive (was: Adding an observer is memory expensive)

2009-09-11 Thread Torsten Radtke
Is this when the first observer is added to each of the 100k objects? Yes, it happens for the first observer I add. But I expressed the problem not good enough. Adding an observer is realized by adding an associated reference (with objc_addAssociatedObject(), new in Snow Leopard) to the

Re: Adding an associated reference is memory expensive (was: Adding an observer is memory expensive)

2009-09-11 Thread Ken Ferry
Hi Torsten, Please file as a bug if you haven't already. That clearly needs to be looked into. For your KVO issue, you can probably work around it by implementing - (void)setObservationInfo:(id)observationInfo; - (id)observationInfo; on the object that you are observing. This provides the

Re: Adding an associated reference is memory expensive (was: Adding an observer is memory expensive)

2009-09-11 Thread Greg Parker
We have your earlier report rdar://7212101. Thanks, Torsten. (Ken didn't see it because the bug didn't pass through his group's hands on its way to my group.) This is a bug in the associated reference machinery. That code keeps a C++ std::hash_map per augmented object, mapping associated