Skip navigation.
 
mlRe: CoreAnimation efficiency
FROM : Chris Ryland
DATE : Thu Mar 06 18:35:27 2008

On Mar 6, 2008, at 5:43 AM, Half Activist wrote:

> As I'm investigating on which drawing techniques to use for a 
> software I'm planing to create,
> imagine a kind of vector drawing program (that's not really that but 
> a somewhat similar).
> In its actual version, all drawing relies on NSBezierPath/Quartz 
> primitives and is really fast.
> Now, I'd like to use CALayers and CoreAnimation extensively, so my 
> questions are the following:
>
> - Should I take care of not using too much Layers like with NSView 
> (currently I have 1 view that draws all). By too much, in the worst 
> case scenario I could use tens of thousands of layers (or more!) 
> (actually ~one per object drawn)
> - Is there a performance slowdown if I use too many of them?
> - Would it take quite a lot of memory?
> - etc.


I ain't no CA expert, but the simple existence of 10K's of layers 
aren't necessarily a problem.

However, in my experience, if you start compositing them all to 
provide a single logical view, you'd be in trouble.

I ran into serious performance issues with just dozens of (admittedly, 
pretty large--1Kx800) layers that were semi-transparent, in 2.5-D 
space. (All of them using simple images.) I'm going to have to do 
something much more intelligent (using tiled layers for producing the 
images on demand), and I have to avoid transparency between layers.

Cheers!
--Chris Ryland / Em Software, Inc. / www.emsoftware.com

Related mailsAuthorDate
mlCoreAnimation efficiency Half Activist Mar 6, 11:43
mlRe: CoreAnimation efficiency Chris Ryland Mar 6, 18:35
mlRe: CoreAnimation efficiency Jens Alfke Mar 6, 22:16