Re: CoreData - Fast Deletion Of Thousands Of ManagedObjects?
Re: CoreData - Fast Deletion Of Thousands Of ManagedObjects?
- Subject: Re: CoreData - Fast Deletion Of Thousands Of ManagedObjects?
- From: Chris Hanson <email@hidden>
- Date: Tue, 20 Dec 2005 12:03:32 -0800
On Dec 20, 2005, at 11:30 AM, Justin Burns wrote:
SQLite has been entirely too slow for my tastes when trying to
import a few tens of thousands of records
How did you structure this import? Does it look anything like this
pseudocode?
get an old-style record
see if a matching record already exists by issuing a fetch
if a matching record doesn't exist:
create a new record
set its attributes
issue a fetch to find related records
set its relationships
I refer to this as a "find-or-create" pattern and it offers many
opportunities for optimization. The most important optimizations
here are to cut down on or eliminate unnecessary fetches, and to
introduce intermediate autorelease pools to prevent unbounded growth
of your working set.
-- 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