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:59:52 -0800
On Dec 3, 2005, at 12:31 PM, Ruslan Zasukhin wrote:
SqlLite stores BLOBs as part of record. When you goto some record,
it load
record into RAM.
This is a Core Data behavior, not an SQLite behavior. When an
instance of an entity is loaded, all of its attributes are loaded.
I want my app to be able to handle upto around 50,000 records and
images. The
store size would probably be around 800 MB in all.
But you still have problem Simon.
5000 records => 2 seconds
50,000 records => 20 seconds.
This would not necessarily be the case.
For example, let's take a hypothetical recipe manager application
that uses an SQLite persistent store and displays Recipe instances in
a table view on launch. Let's assume that the table view is only
tall enough to show 50 Recipes at a time. Let's also assume that all
data loading occurs as a side-effect of the table view being bound
via an array controller configured for the Recipe entity, rather than
via any manual fetches.
The app launches and displays an initial set of Recipes in 2 seconds
with 5000 Recipes. How many Recipes are actually fully realized in
memory at that point? And how would increasing the number of Recipes
influence the launch time, all else being equal?
There will be 50 fully-realized Recipes in memory, because the rest
of the Recipes are represented by faults. Only when they're accessed
-- say because the user scrolls the table view -- will they actually
be brought in.
Increasing the number of Recipe instances in the database will affect
the load time, but by a much smaller factor than asserted above
because all of the data for those instances will stay in the
database. However, the database will still have to be searched and
the results returned in an appropriate ordering -- fortunately,
SQLite (like many other databases) is quite fast at that.
-- 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