Re: Collections can be simple Attributes in Core Data
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