• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fwd: CoreData model optimization? (slow on insert with fetches)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >CoreData model optimization? (slow on insert with fetches) (From: "Hell's KItchen Hell's KItchen" <email@hidden>)
 >Re: CoreData model optimization? (slow on insert with fetches) (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: NSCell subclass editing
  • Next by Date: Re: SOAP authentication header
  • Previous by thread: Re: CoreData model optimization? (slow on insert with fetches)
  • Next by thread: Re: CoreData model optimization? (slow on insert with fetches)
  • Index(es):
    • Date
    • Thread