Core Data: slow saves to persistent store
Core Data: slow saves to persistent store
- Subject: Core Data: slow saves to persistent store
- From: Jed Soane <email@hidden>
- Date: Mon, 15 Aug 2005 16:55:13 +1200
I am working on integrating Core Data into an old application. I am
at the stage where the functionality has been replicated so I am now
dealing with performance problems. The biggest problem is the time
that the NSManagedObjectContext save: method takes.
Our app relies on a database of clips. Every two minutes it downloads
information on any new or changed clips and adds or changes managed
objects. After each download the managed object context is saved.
Here is some debugging output:
16:34:20.140 ClipList initialised containing 282801 clips
16:34:27.944 Downloading updates
16:34:30.290 Ingested 28 clips in 0.045270 seconds
16:34:31.254 Saved database in 0.963969 seconds <--- this is
good
16:34:31.255 ClipList contains 282827 clips
16:36:27.034 Downloading updates
16:36:27.380 Ingested 3 clips in 0.003780 seconds
16:57:58.781 Saved database in 1291.308029 seconds <--- this is BAD
16:57:59.402 ClipList contains 282830 clips
As you can see sometimes saving is fast, sometime it is horrendously
slow, especially considering it can download and save the original
282801 clips in just over 500 seconds. During the save the memory
usage more than doubles and there is a lot of disk-thrashing. So, two
questions:
1. The only thing that should have changed on existing clip objects
between saves are transient attributes. Changing a transient
attribute will put the object in the update list but does this mean
that the object will be saved to the persistent store even though no
persistent attributes have changed?
2. Does anyone have any other suggestion of what could be causing the
slow saves.
Cheers
Jed
_______________________________________________
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