Re: CoreData - large data set is slow to load on app launch - optimisation tips?
Re: CoreData - large data set is slow to load on app launch - optimisation tips?
- Subject: Re: CoreData - large data set is slow to load on app launch - optimisation tips?
- From: Chris Hanson <email@hidden>
- Date: Sat, 3 Dec 2005 14:36:30 -0800
On Dec 3, 2005, at 9:01 AM, Simon Liu wrote:
My app's single SQL store contains over 5,000 instances of an entity,
each with an associated image (jpeg data). There are also other
entities, relationships, etc. The SQL store comes in at around 80MB.
What do the relevant portions of your model and your user interface
look like?
If your initial interface is showing Foo instances modeled like this:
Foo {
title: string;
imageData: binary;
};
and you're showing just the name in a table view, that could explain
the behavior you're seeing. The reason is that when Core Data fires
the faults for your instances, it loads all of their attributes --
attributes aren't loaded individually.
Instead, you should put your image data on the other side of a
relationship:
entity Image {
imageData: binary;
foo: to-one relationship to Foo, inverse image;
};
entity Foo {
title: string;
image: to-one relationship to Image, inverse foo;
};
This way, its image data will only be loaded as a Foo's image
relationship is traversed.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden