Re: setKeys + array operators = slowdown
Re: setKeys + array operators = slowdown
- Subject: Re: setKeys + array operators = slowdown
- From: Chris Hanson <email@hidden>
- Date: Mon, 15 Jan 2007 21:35:10 -0800
On Jan 15, 2007, at 3:28 PM, email@hidden wrote:
My Core Data project has about 300 records of data. The setKeys
method
+ (void)setKeys:(NSArray *)keys
triggerChangeNotificationsForDependentKey:(NSString *)dependentKey
is used for approximately 10 dependent keys. A separate window uses
array operators on the data. However, this combination seems to
cause a massive slowdown on performance of the data calculated and
displayed by the array operators. If I comment out the setKeys
methods, the array operators calculate instantly. My question: is
there a way to temporarily disable the setKeys method when the array
operators first calculate on the 300 records? Or is there a better
way to do this? Or am I missing something?
What type of operations are actually taking place? Are you doing any
manual observation of the keys for which change notifications are
triggered, or are you strictly relying on bindings, and if the latter,
what views' or controllers' bindings?
It could be that whatever is observing those keys is asking for an
excessive amount of information about them. For example, it could be
asking for the new value of the key -- or the old value *and* the new
value of the key -- when all it really needs to know is that the value
changed. (Or for a key representing a to-many relationship such as a
set or array, the actual change itself; e.g. the insertion, deletion,
union, etc.)
The other thing to consider is whether it's most appropriate for your
needs to be doing calculations on the data via array operators in
bindings, rather than in your model layer. Typically calculations are
most efficiently (and most cleanly) performed via code, and then
reflected in your human interface via bindings. That way you're not
relying on side-effects of your human interface in your model layer,
and you're also not creating notification storms back and forth
between your layers.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden