• 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
Multithreading NSBezierPath creation and stroking. Measuring performance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multithreading NSBezierPath creation and stroking. Measuring performance


  • Subject: Multithreading NSBezierPath creation and stroking. Measuring performance
  • From: Karolis Ramanauskas <email@hidden>
  • Date: Tue, 27 Oct 2009 02:05:28 -0500

Good day,

For the last few days I've been working on my own "2D Scatter Plot View" all
is going great and it looks nice:

http://i729.photobucket.com/albums/ww297/karolisr/Screenshot2009-10-27at12636AM.png

At this point I started optimizing drawing, so I implemented some cacheing,
etc. and I see significant performance gains. Now my attention is on drawing
multiple series as can be seen in the picture above. I decided that this is
a great place to introduce some multithreading (note that I have never done
any multithreading until two days ago). I've been reading documentation and
this is what I came up with:

   1. For each series create an operation using NSInvocationOperation
   2. The operation consists of:
      - looping through the points in the series and creating an
      NSBezierPath
      - creating NSBitmapImageRep
      - creating NSGraphicsContext with that NSBitmapImageRep
      - stroking the path onto that Bitmap
      - adding Bitmap to an array
   3. In the queue I wait until all the operations are finished and then
   proceed to loop over all Bitmaps and drawing them

I will post detailed code in reply to this post soon (original message was
too big and required approval). My questions are:

   1. Is this a correct approach?
   2. How do I measure (using instruments, I guess) the performance gain, if
   any?

Thanks to everyone,
Karolis
_______________________________________________

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

  • Follow-Ups:
    • Re: Multithreading NSBezierPath creation and stroking. Measuring performance
      • From: "Sean McBride" <email@hidden>
    • Re: Multithreading NSBezierPath creation and stroking. Measuring performance
      • From: Karolis Ramanauskas <email@hidden>
  • Prev by Date: Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
  • Next by Date: Re: Multithreading NSBezierPath creation and stroking. Measuring performance
  • Previous by thread: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
  • Next by thread: Re: Multithreading NSBezierPath creation and stroking. Measuring performance
  • Index(es):
    • Date
    • Thread