• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString drawAt: ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString drawAt: ...


  • Subject: Re: NSString drawAt: ...
  • From: Paul Fox <email@hidden>
  • Date: Fri, 21 Jun 2002 21:56:21 +0100

> On Friday, June 21, 2002, at 01:37 PM, Paul Fox wrote:
>
> > I have a question regarding NSString and drawing. Drawing is slow -
> > unimaginably slow, and I have seen questions about this before.
>
> There is currently an issue with string drawing, that drawing into an
> unflipped view causes a temporary flipped subview to be added. We hope
> to address this issue in the future, but in the meantime you will be
> much better served by making your view flipped. There will be
> considerable improvements in string drawing performance for Jaguar, but
> for a view that relies extensively on drawing text--especially one with
> persistent text, such as a view that edits text--you are likely to get
> much better performance by using NSLayoutManager directly rather than
> the string drawing convenience APIs. This is, for example, what
> NSTextView itself does. The CircleView example shows how to use
> NSLayoutManager for drawing strings.
>
> Douglas Davidson

Just did a test - thought I would post to the list on this. I modified
my simple app to do 1000 calls to drawAtPoint and then exit -- result
of the Unix 'time' command:

real 0m19.345s
user 0m3.140s
sys 0m0.110s

Result when same code has the view flipped (isFlipped method returns YES):

real 0m4.916s
user 0m1.600s
sys 0m0.120s

ie about 2x the performance (ignore the real time). Thats pretty impressive,
and bizarre this is a bug in cocoa in 10.1. But that will help an awful
lot. I guess it goes to show that a lot of people do flipping (because
its more natural). Now, shame the docs never mentioned anything like
this.

regards all
+-------------------------------------------------------------------------+
| CRiSP - Flexible editor | CRiSP, syn. for BRIEF |#
| | Internet: email@hidden |#
| If you get no reply for | WWW: (mine) http://www.crisp.demon.co.uk |#
| support, please check your | WWW: http://www.crisp.com |#
| Reply-To: email address. | WWW: http://www.pacemaker.co.uk |#
+-------------------------------------------------------------------------+#
###########################################################################
_______________________________________________
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.

  • Prev by Date: Re: NSString drawAt: ...
  • Next by Date: Vanishing Toolbar, Part III
  • Previous by thread: Re: NSString drawAt: ...
  • Next by thread: Re: NSString drawAt: ...
  • Index(es):
    • Date
    • Thread