ios - Performance issues with AFIncrementalStore -


i'm experimenting afincrementalstore, awesome, i'm noticing having performance issues.

specifically, i'm using bring down bunch of facebook friends info facebook graph api, , i'm seeing pretty slow clocktimes save operations. context, i'm loading in 900 records. instruments telling me problem line this:

 nsmanagedobjectid *backingobjectid = [self objectidforbackingobjectforentity:entity withresourceidentifier:resourceidentifier]; 

which in turn calls this

[backingcontext performblockandwait:^{         backingobjectid = [[backingcontext executefetchrequest:fetchrequest error:&error] lastobject];     }]; 

has had experience using afincremental store larger data sets?

somethign else don't quite understand why action happening on main thread when getting kicked off using performblockandwait operation context privatequeueconcurrencytype. appreciated!

just partial answer:

performblockandwait: execute block on private queue, calling thread "appear wait" until block finished. (note "appear wait", explained below).

the queue underlaying mechanism synchronize access shared resources. ensures shared resources can accessed concurrently.

now, gcd can apply optimization regarding selecting thread used drive queue: if dispatch synchronously gcd may choose use current thread drives private dedicated queue.

note: blocks enqueued on particular queue can executed on any thread. nonetheless, "execution context" queue - determines synchronization.

so, in other words performblockandwait: appear if called synchronously. if block executed on same thread, thread not block. switches private queue when executing block (and thereby guaranties shared access). makes sense name of message indicates: "..andwait".


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -