> Date: Fri, 16 Jan 2009 13:03:24 +0100
> From: Matteo Manferdini <mat.maili...@gmail.com>
> Subject: Long load time of managed object context
> 
> I'm testing performance in my application, to see how it behaves with
> a big load of data inside of it. My application is core data based and
> uses array controllers in entity mode to fetch data.
> 
> What I discovered is that my app fetched all the managed objects
> present in core data, so I set the fetch predicate of array
> controllers at startup. This reduced dramatically the number of
> objects fetched. The problem though is that my app still takes a lot
> of time to start when is full of data.
> 
> I ran the app within instruments, and the core data fetches instrument
> confirms that this is not the problem (my app fetches only 20-30
> objects when starts). But running it under Shark I can see that for
> 4-5 seconds after startup the only call on the stack is to the app
> managed object context. So I think it has something to do with
> interaction between managed object context and data stored, even if I
> don't fetch all the data. If I empty the app or leave little data
> inside of it, it starts very quickly.
> 
> Does somebody know why this happens? Am I missing something obvious?
> Why does it take so much to the managed object context to load if I
> only fetch few objects? I always read that core data scales well and
> the programming guide states that 10.000 objects are not much for core
> data, but in my app it makes a big difference, so I'm wondering where
> I am wrong.

You don't say what format you're using, but if you're using XML, the entire
XML file has to be loaded and parsed, even before you fetch any objects. m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, http://tinyurl.com/2ouo3b
Take Control of Customizing Leopard, http://tinyurl.com/2t9629
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com



_______________________________________________

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