Hi all,

I'm profiling some code to find out where it's spending all its time. The code is a threaded task that parses a file and turns what it finds into a bunch of objects. Some of these files are pretty large, generating 25,000+ objects.

Basically after fixing a few slow bits with a useful improvement, I'm still looking for more speed. Right now, I find that the code is spending 45% of its time in [NSNotificationCenter - addObserver:selector:name:object:] which is by far the biggest chunk. The call stack leading to this call is taking negligible time, but it then spends all its time in here (or specifically, in _CFXNotificationRegister which it calls)

My question is, is this a known slow spot? I've never noticed NSNotificationCentre being so slow before, and can't think why it would be. And of course, what can I do to help it? I've temporarily removed the addObserver call in the code and sure enough it goes a lot faster. Trouble is, I do need that notification. Any ideas?

--Graham


_______________________________________________

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 arch...@mail-archive.com

Reply via email to