Re: drawing efficiently
Re: drawing efficiently
- Subject: Re: drawing efficiently
- From: Ondra Cada <email@hidden>
- Date: Mon, 25 Mar 2002 11:51:00 +0100
On Monday, March 25, 2002, at 04:48 , Oscar Bascara wrote:
Another question about drawing efficiently has to do with the use of
factory methods. How efficient is it to alloc, init, and autorelease
many of these temporary objects every time drawRect: is called, like with
[NSColor blackColor] and the NSBezierPath objects? Or, is the
bottlenecking in the actual rendering (stroke, fill, etc.) and time spent
handling temporarily created objects not significant?
Autoreleasing is generally efficient enough: first just write the thing so
that it works, the most convenient way from the programmer's POV. It is
*pretty* probable that it will work efficiently enough, even despite those
grave bugs Apple did in redrawing code (in short, many views get very
often utterly unnecesarily redrawn).
If your app has the bad luck of falling into the small number of those
which are *not* efficient enough, you can use Sampler and optimalize
afterwards.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.