Fwd: CoreData model optimization? (slow on insert with fetches)
Fwd: CoreData model optimization? (slow on insert with fetches)
- Subject: Fwd: CoreData model optimization? (slow on insert with fetches)
- From: "Hell's KItchen Hell's KItchen" <email@hidden>
- Date: Tue, 2 Oct 2007 17:55:16 +0200
I can see two different part where the app/this model is slow:
- fetching the list of thread root (= first message of a thread
without any parent)
- inserting lots of messages into managed context
about the first part, Core data seems to be slow with a simpe model
with a simple Message entity that have parent/child relationship (so
where there aren't any classification in ChildNode/RootNode).
The other part regards inserting lot of message and it's linked to the
fact that I've a relationship for subject and author. Core Data is
slow when I try to associate a subject to to the message (in fact CD
need to search for an existing subject entity with that text and
return it/create a new entity if the search is falied); it's very slow
because at each insert it needs to fetch for other two entities
requests.
So I'm searching a way to optimize it.
Probability the first thing to do is to incapsulate as attributes both
author and subject (and I'll eliminate the problem with insert time).
Then I need to speed up fetch for root parents; is childnode/rootnode
separation a good way to do it (in fact I'll have less objects to
fetch if I'll search for only root nodes instead of all
messages-without-parent, or not?).
2007/10/2, I. Savant <email@hidden>:
> > Why?
>
> Missing information: What specifically is slow? What are you
> fetching that is slow? How ***EXACTLY*** are you fetching it? Are you
> sure you're not doing something to cause it to be fetched multiple
> times? These details directly affect performance and you've left them
> all out for some reason.
>
> Suggestions: Read back over the Core Data Programming Guide and the
> Key-Value Coding Programming Guide. The former so you can better
> understand how things work and the latter so you can name things a
> little better (your attribute names are bizarre).
>
> Regarding overall design of your model, Mail deals with "Message".
> A message may belong to a thread (and may be sorted by thread) but a
> message is still a message. I would think separating out "Subject" as
> a separate entity would only cost you more work, not less.
>
> How about you describe the *basic*, plain-English model you're
> dealing with (rather than the "optimized" version you posted)? It'd
> make it easier to make suggestions.
>
> --
> I.S.
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden