• 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/NSManagedObject accessor performance problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData/NSManagedObject accessor performance problems


  • Subject: Re: CoreData/NSManagedObject accessor performance problems
  • From: Andrew Bush <email@hidden>
  • Date: Mon, 18 Dec 2006 23:05:17 +1300

Hi malcom,

It is unlikely that a simple predicate filter operation on a simple numeric value would cause the sort of effect you're describing.

good call. turns out all the history objects were faulted :)

Wild random guessing is not helpful: measure using Shark.

yep, lots and lots of calls to load the individual records, thanks.

Ive fixed it by checking through and batch faulting any that are faults.


this has improved things noticeably but it is still a little slow...one thing that I noticed is that arrangeObjects appears to be called on the NSArrayController a _lot_


I put a NSLog in the overridden arrangeObjects that prints out the object count each time it is called. there seem to be a lot of repeated calls with exactly the same number of objects within a very short space of time, the printout looks something like:

arrangeObjects: 3394 3394 faults
arrangeObjects: 3394 0 faults
arrangeObjects: 3394 0 faults
arrangeObjects: 3394 0 faults
arrangeObjects: 3394 0 faults
arrangeObjects: 3394 0 faults
arrangeObjects: 3394 0 faults
arrangeObjects: 3394 0 faults
arrangeObjects: 944 944 faults
arrangeObjects: 944 0 faults
arrangeObjects: 944 0 faults
arrangeObjects: 944 0 faults
arrangeObjects: 1224 1224 faults
arrangeObjects: 1224 0 faults
arrangeObjects: 1224 0 faults
arrangeObjects: 1224 0 faults
arrangeObjects: 1224 0 faults
arrangeObjects: 1224 0 faults
arrangeObjects: 1224 0 faults
arrangeObjects: 1224 0 faults


now it looks like maybe its calling with the same data over and over, but its hard to work out why or what to do about it.


it seems wasteful to be redoing the same stuff over and over....even if the faults are gone the second time through (and they are, it stops faulting each one after the first call through)

is there some way to get a stack trace from within cocoa so I can work out who is calling arrange objects, and why?


thanks for your help.


Yours cheerfully,


Andrew Bush

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >CoreData/NSManagedObject accessor performance problems (From: Andrew Bush <email@hidden>)
 >Re: CoreData/NSManagedObject accessor performance problems (From: Andrew Bush <email@hidden>)
 >Re: CoreData/NSManagedObject accessor performance problems (From: Scott Stevenson <email@hidden>)
 >Re: CoreData/NSManagedObject accessor performance problems (From: Andrew Bush <email@hidden>)
 >Re: CoreData/NSManagedObject accessor performance problems (From: Andrew Bush <email@hidden>)

  • Prev by Date: [Q2] is it shallow copy or deep copy? and why things are not retrieved well?
  • Next by Date: Re: Getting color attribute from NSFontPanel/NSFontManager
  • Previous by thread: Re: CoreData/NSManagedObject accessor performance problems
  • Next by thread: Re: Cocoa-dev Digest, Vol 3, Issue 1410
  • Index(es):
    • Date
    • Thread