On Sep 9, 2008, at 6:48 PM, Markus Spoettl wrote:

What I don't understand is why adding the auto-release pool has such a dramatic impact on registering observers on the objects. Anyone know why?

It would simply be that the methods triggered by KVC/KVO (the observations) are creating a huge amount of objects. Uncomment the pool and watch your memory usage in Activity Monitor. It'll probably be grabbing all available memory and paging out like crazy, which is what's causing it to be so slow.

Surely adding 330 items to an array shouldn't take a minute on any machine from this century. I think your code is doing something you're not realizing. You could: a) have a method that on each observation explicitly creates a bajillion objects
b) have a bajillion observers that each create a bunch of objects
c) have enough observers and have enough oddly placed observations and method calls that you literally end up calling the same methods over many many times because it recurses unintentionally, for each object added to the array.


Use Instruments to figure out what objects are being created, from where, and examine your logic to see if they're actually supposed to be created.


*shrugs*


Hope that helps :)

--
Seth Willits




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to