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 15:23:09 +1200
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.
This worked very well.
After changing a transient attribute on 286 000 managed objects, then
saving the managed object context took 15-20 minutes.
After changing a member in 286 000 instances of an NSManagedObject
subclass, saving took 0.000928 seconds (because there was nothing to
save). This was using the same data model with the single transient
attribute removed.
This was all the code needed to do it:
@interface Clip : NSManagedObject
{
// This was a transient attribute in our model
Boolean hasThumbnailFile;
}
@end
You've got to love KVC.
Now if someone can give me a good explanation of why changing a
transient attribute should add a managed object to the update list
I'd be happy. Am I misunderstanding what transient attributes are?
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