Re: NSString drawAt: ...
Re: NSString drawAt: ...
- Subject: Re: NSString drawAt: ...
- From: Paul Fox <email@hidden>
- Date: Tue, 25 Jun 2002 08:30:22 +0100
>
On what machine where these tests performed, and how long were the
>
strings? I find that including too many strings, for chart labels,
>
etc..., causes resizing to suffer horribly.
This is a 500MHz G3 iBook. The strings arent long - sort of "Hello world".
I just put a repeat 10,000 loop around the drawing core to get
some measurable times.
>
I'm not expecting 30 frames a second, but on a 500 MHz G3 I'd like to
>
see less than 1-2 seconds between frames.
This is a text editor and the affected code is the core drawing
code inside an NSView (and not using any of the
NSText* objects). I am trying to do a number of things, include
ensure the app feels responsive when autorepeating and minimize startup
times.
>
I did find placing the strings in a layout, and drawing the glyphs
>
directly did speed things up, but made the drawing routine very
>
complicated.
I tried that but couldnt get good enough results. I started with
the CircleView.m code which someone referred to me and after
chopping out the 'draw text in a circle' stuff, I got to within
25% of CircleView.m's speed and I gave up at that point
(becuase the code looks more complex and still doesnt do all it
needs to do). But I havent compared the speed to the native
drawing (I think it was about the same as the flipped-drawing case).
If you have any sample code you could send, then that would be useful.
At this point I am considering abandoning Cocoa drawing and resorting
to the CG functions instead.
>
Cheers,
>
Brant
>
>
>
On Friday, June 21, 2002, at 10:05 PM, email@hidden
>
wrote:
>
>
> 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.
>
>
>
+-------------------------------------------------------------------------+
| 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.