Re: Performance: Drawing hundreds of short text strings
Re: Performance: Drawing hundreds of short text strings
- Subject: Re: Performance: Drawing hundreds of short text strings
- From: Aki Inoue <email@hidden>
- Date: Tue, 21 Dec 2010 11:04:31 -0800
Yes, we optimized NSStringDrawing API since the documentation discouraging its use was first written.
In fact, for some of short simple string rendering, it's the fastest on the platform (use -drawWithRect:... variants for the maximum efficiency if possible).
So, as already mentioned, use the cleanest approach and tune if necessary.
Note CoreText is a core layout engine, a building block for higher-level text engines such as AppKit. It doesn't necessarily perform better than higher-level engines which are caching by utilizing contextual info available.
Aki
On 2010/12/21, at 7:02, email@hidden wrote:
> Hi Mike,
>
> Seconding Sherm and Joar, this will be the easiest way to get started. Down the line, if that doesn't work, have a look at Core Text.
>
> Also, I have been developing an application for drawing with text. I draw a few hundred individual letters at a time, then commit them to a graphics context so that the next time the whole view is drawn, one context is drawn rather than 1 context + n letters.
>
> T
>
>
> On 2010-12-21, at 12:04 AM, Sherm Pendley wrote:
>
>> On Mon, Dec 20, 2010 at 11:53 PM, Joar Wingfors <email@hidden> wrote:
>>>
>>> On 20 dec 2010, at 01.22, Mark Coniglio wrote:
>>>
>>>> My application needs to draw hundreds of short text strings into an NSView. After reviewing the Cocoa documentation on drawing text, I am left unsure as to how to do this with the highest level of efficiency.
>>>
>>> Don't optimize in the dark! Implement something in the most straight forward way you can imagine, and then measure the performance. If you find that it doesn't perform well enough, use your measurements to guide you to a better implementation. I don't think that we have enough information yet to provide really good suggestions.
>>
>> Seconded. The NSString "convenience" methods are the easiest, most
>> straightforward way, so I'd try those first. If and only if they
>> didn't perform well enough, then I'd start looking for a
>> better-performing alternative.
>>
>> sherm--
>>
>> --
>> Cocoa programming in Perl:
>> http://camelbones.sourceforge.net
>> _______________________________________________
>>
>> 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
>
> _______________________________________________
>
> 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
_______________________________________________
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