Database Reference
In-Depth Information
Figure 14—Impacts of deleting a recipe
are not currently in memory, then the NSManagedObjectContext must retrieve them
from the disk to accomplish all of this.
Therefore, when we are doing deletes, especially large deletes, it can be a
performance improvement to fetch all the relationships prior to the delete.
Faulting and Disk Access
Firing a fault does not always mean that the data is going to be read from
disk. Depending on how we have requested the data in the first place or what
happened earlier in the NSManagedObject object's life span, it is quite possible
that the data will be loaded from cache instead.
Likewise, faulting an NSManagedObject does not guarantee that it will be written
back out to disk nor does it guarantee that it will be removed from the cache.
If the object has no changes, then there is nothing to write to disk, and it is
quite possible it will remain in the cache for an unknown period of time.
Easily one of the best ways to check to see whether the firing of a fault is in
fact causing disk access is to monitor our application with Instruments. By
using the Core Data template, we can use the “cache miss” instrument to
 
 
 
Search WWH ::




Custom Search