Re: addSubview bottleneck
Re: addSubview bottleneck
- Subject: Re: addSubview bottleneck
- From: Michael Ash <email@hidden>
- Date: Sun, 25 Jan 2009 10:17:21 -0500
On Sat, Jan 24, 2009 at 5:29 PM, Twisted Theory
<email@hidden> wrote:
> Hi,
>
> I am constructing an application that draws rooted trees (graphs with a
> distinguished 'first' node) by creating an NSView subclass for each node and
> adding them as subviews of the graph view.
>
> There is a big problem when the number of nodes in the tree is large: adding
> the subviews takes a very long time. For example, one of my trees has
> around 60,000 nodes. It takes about 1.5 seconds to create all of the
> objects, and about 200 seconds to add them as subviews.
>
> Can anyone suggest a way to speed the process up? Multithreading didn't
> really improve matters.
As always, profile the code first, see what's slow, and then you can
see what area you need to target to make it faster.
Mike
_______________________________________________
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