Re: Core Data: slow saves to persistent store
Re: Core Data: slow saves to persistent store
- Subject: Re: Core Data: slow saves to persistent store
- From: Jed Soane <email@hidden>
- Date: Wed, 17 Aug 2005 13:47:47 +1200
I have experimented further by using our data model in a basic Core
Data Application project ala the NSPersistentDocument Core Data
tutorial and found that changing the value of a transient attribute
in a large number of managed objects caused the very slow saves
(15-20 minutes) that we were also seeing in our app. So
1. Is there a way around the fact that changing a transient attribute
marks the managed object as changed?
or
2. Would it make sense to subclass NSManagedObject and take the
transient attributes out of our model and handle them "manually" in
our subclass? We could probably sacrifice searching and sorting on
those attributes.
Cheers
Jed
On Aug 15, 2005, at 4:55 PM, Jed Soane wrote:
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.
_______________________________________________
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