• 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: Opinion: Core Data or roll my own?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opinion: Core Data or roll my own?


  • Subject: Re: Opinion: Core Data or roll my own?
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 08 Apr 2014 19:38:32 -0700

On Apr 8, 2014, at 5:31 PM, BareFeetWare <email@hidden> wrote:

> for (NSDictionary* rowDict in query.resultArray) {
> 	NSLog(@"%@: (%@, %@)", rowDict[@"Name"], rowDict[@"Latitude"], rowDict[@"Longitude"]);
> }
>
> Or to just get row 3's value for Name:
>
> query.resultArray[3][@"Name"];

Watch out: I have found this degree of abstraction to become a major performance bottleneck. It results in large numbers of object allocations and message-sends during query evaluation. Late in development of the first implementation of Safari RSS in OS X 10.4, I had to go through code like this and try various nasty tricks to cache and reuse objects, to try to speed it up enough, because it was too late to redesign the query APIs to be closer to the metal.

The query API in FMDB itself is more efficient, and I think clearer, although not perfect. In my current usage I make sure to only use the numeric-indexed accessors (i.e. get column 2 rather than column “Latitude”) because they’re much faster.

—Jens
_______________________________________________

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: 
 >Re: Opinion: Core Data or roll my own? (From: BareFeetWare <email@hidden>)

  • Prev by Date: Re: Opinion: Core Data or roll my own?
  • Next by Date: Re: Excessive open gui graphics files on Mavericks
  • Previous by thread: Re: Opinion: Core Data or roll my own?
  • Next by thread: Re: Opinion: Core Data or roll my own?
  • Index(es):
    • Date
    • Thread