Re: Opinion: Core Data or roll my own?
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