• 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: Drawing speed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing speed


  • Subject: Re: Drawing speed
  • From: Henry McGilton <email@hidden>
  • Date: Mon, 7 Jul 2003 22:43:05 -0700

On Monday, July 7, 2003, at 04:46 PM, Chuck Soper wrote:

I'm about to implement some code that draws about 2500 polygons. All polygons are closed and the total number of vertices is around two hundred thousand. My polygon data will rarely change so if the drawing is slow I think I should be able to optimize by caching to an NSBitmapImageRep.

I plan to implement the code with Quartz. If it's too slow then I'll try to optimize. If it's still too slow then I'll consider moving to OpenGL. I understand that OpenGL is the way to go for the absolute fastest drawing, yet I don't know if I need it and it's my impression that it could significantly increase my development time.

Does this sound like a good approach?
Thanks, Chuck

Hello Chuck,
first, you have to measure things to determine what parts of the
code are taking up the time. Premature Optimisation Is The Root of
All Evil, or something like that.

I am in the same boat at the moment. I have created a Gouraud
shader that performs triangle subdivision to get to a place
where the delta of the coordinates or the delta of the colour
components is small.

Having performed the triangle subdivision I then use Bezier path
to draw the filled triangles. The drawing appears slow to me at
this time. My test application involves 16,384 triangles, for a
total of 49,152 vertices, with 147,456 colour components. And then
these colour components have to be interpolated for the specific
triangle being filled.

So, my next step is to put in some timing brackets. I do not know
right now whether the time is being consumed in the triangle subdivision
code (which is implemented as a pure C function), or in the Bezier
path code, or in the code that performs the colour interpolation.

So, I need to put in some timing code to find out who is doing what
to whom, how often, and how fast . . . I want to determine how much
time is taken creating colours, how much time is used in the
triangle subdivision, and how much time is used in defining the
Bezier paths.

Given that drawing speed seems to be a popular topic right now,
I will report to the list when I have some definitive numbers.

Best Wishes,
........ Henry


===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
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.

  • Follow-Ups:
    • Re: Drawing speed
      • From: Cameron Hayne <email@hidden>
    • Re: Drawing speed
      • From: "Alastair J.Houghton" <email@hidden>
References: 
 >Drawing speed (From: Chuck Soper <email@hidden>)

  • Prev by Date: Re: NSHTTPURLResponse
  • Next by Date: debugger won't start
  • Previous by thread: Drawing speed
  • Next by thread: Re: Drawing speed
  • Index(es):
    • Date
    • Thread