• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data: slow saves to persistent store
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Core Data: slow saves to persistent store
      • From: Adam Knight <email@hidden>
    • Re: Core Data: slow saves to persistent store
      • From: Jim Correia <email@hidden>
References: 
 >Core Data: slow saves to persistent store (From: Jed Soane <email@hidden>)
 >Re: Core Data: slow saves to persistent store (From: Jed Soane <email@hidden>)

  • Prev by Date: Communicating between applications
  • Next by Date: Re: Core Data: slow saves to persistent store
  • Previous by thread: Re: Core Data: slow saves to persistent store
  • Next by thread: Re: Core Data: slow saves to persistent store
  • Index(es):
    • Date
    • Thread