• 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: Coredata, unfaulting and NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coredata, unfaulting and NSArrayController


  • Subject: Re: Coredata, unfaulting and NSArrayController
  • From: mmalcolm crawford <email@hidden>
  • Date: Thu, 27 Oct 2005 15:39:02 -0700


On Oct 27, 2005, at 3:04 AM, Guillaume Rager wrote:

Second method is to fetch all data using an NSFetchRequest instance, returned objects are fault (isFault return YES), batch faulting technique does not work (something wrong with documentation (*)) and if we need to display these objects in tableview datasource method, this is extremelly slow because each object has to be unfaulted.
So the question is, how can NSArrayController load and UNFAULT many objects (10000 and more...) so quickly ???

The documentation is correct.

Executing a fetch does retrieve the data for the objects returned, and the results are cached in memory. Executing a fetch does not, however, explicitly unfault any existing faults, so that in your scenario -isFault will still return YES immediately after the fetch. When the faults are fired, however, the data is retrieved from the cache, and additional fetches are not required.

Thus the pattern described in the documentation -- performing a single fetch -- is significantly less expensive than unfaulting each object individually (which results in a fetch per fault).

[The difference with the array controller is that the controller itself unfaults the objects (and hits the cache) before you have a chance to call -isFault.]

mmalc
(With thanks to BT.)

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Coredata, unfaulting and NSArrayController (From: Guillaume Rager <email@hidden>)

  • Prev by Date: Re: Accessor macros used by GNUstep but not Cocoa?
  • Next by Date: Re: Complex Source List & Selection
  • Previous by thread: Coredata, unfaulting and NSArrayController
  • Next by thread: SIGTRAP problem
  • Index(es):
    • Date
    • Thread