NSArrayController performance using NSManagedObject content on 10.6
NSArrayController performance using NSManagedObject content on 10.6
- Subject: NSArrayController performance using NSManagedObject content on 10.6
- From: "email@hidden" <email@hidden>
- Date: Thu, 15 Oct 2009 13:01:25 +0100
I am using an array of simple NSManagedObject subclasses bound to an
NSArrayController.
The object graph is shallow with a tiny number of objects (<500).
All objects are loaded into the NSArrayController MOC using an
NSFetchRequest with setReturnsObjectsAsFaults:YES.
Therefore no faulting should be occurring.
The app is garbage collected.
The CoreData atore type is XML.
The NSArrayController's arrangedObjects is bound to an NSTableView.
The NSArrayController's filterPredicate is bound to an NSSearchField.
Under 10.5 manipulating the NSArrayController's arrangedObjects using
either sort descriptors or the predicate is quick.
Under 10.6 the performance is noticeably worse.
Shark shows the following for both 10.5 and 10.6 when the filter
predicate is updated.
The issue seems to make itself manifest on the lines marked >>.
Obviously the implementation here is different.
NSPointerArray -compact seems to be the centre of activity.
What options do I have here to try and restore performance?
Is the issue related to the use of NSManagedObject content at all?
OS X 10.6 (poor)
0.0% 89.5% AppKit -[NSArrayController
setFilterPredicate:]
0.0% 89.5% AppKit -[NSArrayController
_didChangeArrangementCriteriaWithOperationsMask:useBasis:]
0.0% 65.3% AppKit -[NSArrayController
_arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis
:]
0.0% 49.7% AppKit -[NSArrayController
_setObjects:]
0.0% 49.7% AppKit -
[_NSModelObservingTracker
setIndexReferenceModelObjectArray:clearAllModelObjectObserving:]
0.0% 49.7% AppKit -
[_NSModelObservingTracker clearAllModelObjectObserving]
0.0% 49.6% AppKit -
[_NSModelObservingTracker
_registerOrUnregister:observerNotificationsForModelObject:]
0.0% 49.6% Foundation -[NSObject
(NSKeyValueObserverRegistration) removeObserver:forKeyPath:]
0.0% 49.5% Foundation -[NSObject
(NSKeyValueObserverRegistration) _removeObserver:forProperty:]
0.1% 49.0% Foundation
_NSKeyValueObservationInfoCreateByRemoving
0.0% 48.5% Foundation -
[NSKeyValueObservationInfo _initWithObservances:count:]
>>> 3.6% 46.4% Foundation -
[NSConcretePointerArray compact]
10.0% 42.8% Foundation
readWeakAt
9.7% 31.4% libobjc.A.dylib
objc_read_weak
19.6% 19.8% libauto.dylib
auto_read_weak_reference
0.2% 0.2%
libSystem.B.dylib __spin_lock
OS X 10.5 (Good)
0.0% 37.6% AppKit -[NSArrayController
setFilterPredicate:]
0.0% 37.6% AppKit -[NSArrayController
_didChangeArrangementCriteriaWithOperationsMask:useBasis:]
0.0% 29.9% AppKit -[NSArrayController
_arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis
:]
0.0% 13.3% AppKit -[NSArrayController
_setObjects:]
0.0% 12.4% AppKit -[NSArrayController
_updateObservingForAutomaticallyRearrangingObjects]
0.0% 12.1% AppKit -
[_NSModelObservingTracker
startObservingModelObjectsAtReferenceIndexes:]
0.0% 12.1% AppKit -
[_NSModelObservingTracker _startObservingModelObject:]
0.0% 12.1% AppKit -
[_NSModelObservingTracker
_registerOrUnregister:observerNotificationsForModelObject:]
0.0% 12.1% AppKit -
[_NSModelObservingTracker
_registerOrUnregister:observerNotificationsForKeyPath:ofModelObject:]
0.3% 12.1% Foundation -[NSObject
(NSKeyValueObserverRegistration)
addObserver:forKeyPath:options:context:]
0.3% 10.7% Foundation -[NSObject
(NSKeyValueObserverRegistration)
_addObserver:forProperty:options:context:]
0.0% 9.5% Foundation
_NSKeyValueObservationInfoCreateByAdding
0.9% 6.5% Foundation -
[NSKeyValueObservationInfo _initWithObservances:count:]
>>> 0.0% 4.1% CoreFoundation -
[__NSPlaceholderArray initWithObjects:count:]
0.3% 4.1% CoreFoundation
CFArrayCreate
0.0% 2.7% CoreFoundation
__CFArrayInit
0.0% 2.7% CoreFoundation
_CFRuntimeCreateInstance
0.0% 2.7% CoreFoundation
CFAllocatorAllocate
0.0% 2.7% libauto.dylib
auto_zone_allocate_object
0.0% 2.7% libauto.dylib
Auto::Zone::allocate_small_medium(unsigned long, unsigned int, bool,
bool)
0.0% 2.7%
libauto.dylib
Auto::Region::allocate(unsigned long, unsigned int, bool, bool)
0.0% 2.7%
libauto.dylib
Auto::Admin::find_allocation(unsigned long, unsigned int, bool, bool&)
2.7% 2.7%
libSystem.B.dylib
__spin_lock
Jonathan Mitchell
Developer
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden