NSTreeController delete slowness...
NSTreeController delete slowness...
i've got an NSOutlineView bound via an NSTreeController to a mutable
set in my model. in the sample i've been exploring, my outline
consists of 608 top level items in the outline, and only goes one
level deep. each top level item has 2 or more children, and there are
a total of 1393 children.
deletion can only happen for the top level objects, and when the user
deletes one or more of my items, i create a set of the objects to be
deleted and the call:
[myController removeProxySet: topLevelObjects];
the code for removeProxySet is:
- (void) removeProxySet: (NSSet*) inSet
{
[[self proxySet] minusSet: inSet];
}
where proxySet is simply the iVar mutable set in my controller that
has my model objects.
this all works fine and when the user asks to delete one or more top
level items, they appropriately disappear from the outline view.
however, it is rather slow!
when i looked at this with Shark, deleting just 2 of the top level
items spent 750 ms in [NSTreeController setContent], which is called
from Foundation NSKVOMinusSetAndNotify (in response to my call of
minusSet). if i delete ~600 of the top level items, it takes 1.9
seconds! there are obviously some calls to some of my code to
access values for the various columns of the outline view, but the
overwhelming majority of the time is spent in app kit and foundation
code, mostly in tree controller and friends.
this is on a 3GHz MacPro with 6G of memory and a total of 4 cores. i
don't believe the disk is being hit for any of this.
(fwiw, i obtained my numbers by putting shark into remote mode and
simply starting and stopping it when deleting my items.)
this seems unreasonably slow to me. i realize that i'm not posting
very much code, but since so little of my code seems to be involved
in the slowness, i didn't think it really relevant. should i be doing
something other than removeProxySet and minusSet?
thanx,
ken
_______________________________________________
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