On Apr 8, 2014, at 5:31 PM, BareFeetWare <list.develo...@barefeetware.com> 
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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to