• 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: Collections can be simple Attributes in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Collections can be simple Attributes in Core Data


  • Subject: Re: Collections can be simple Attributes in Core Data
  • From: Jerry Krinock <email@hidden>
  • Date: Tue, 30 Sep 2008 10:14:15 -0700


On 2008 Sep, 25, at 18:08, Jerry Krinock wrote:

I'm surprised that I've never seen this discussed or documented. Is this going to get me into any trouble?

Conclusion

So far I haven't seen any trouble, but some quick tests indicate that when subsequently invoking -[NSManagedObjectContext save:], the cost of storing an NSSet-of-NSStrings attribute is many times the cost of storing a simple String attribute, if you leave the NSSet's "Transformer" field blank and thus use the default transformer, which is probably NS/Un/Archiver.

I was able to recover the performance hit by implementing a custom transformer. Sorry, I did not take the time to isolate and measure the effect of all the factors affecting performance, because after my transformer was written and tested, ^any^ performance improvement, for me, was free :) My transformer for this case UTF8-encodes strings to datas, then concatenates the datas with NULL delimiters. Escaping is not necessary since UTF8 encoding will never produce a NULL.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Collections can be simple Attributes in Core Data (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: To determine if the application is running from a network volume?
  • Next by Date: Re: Questions on An NSOpenGL Application Design
  • Previous by thread: Re: Collections can be simple Attributes in Core Data
  • Next by thread: KVO observing across to-many relationships
  • Index(es):
    • Date
    • Thread