• 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
Speeding up image drawing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Speeding up image drawing?


  • Subject: Speeding up image drawing?
  • From: Arbit Richardi <email@hidden>
  • Date: Mon, 31 Oct 2011 18:44:12 -0700

I'm looking for tips to speed image drawing on OS X — this is a
primary function of my application. I started out naively with
NSImage, switched to CGImage, tried layer backing, and now draw
directly into a hosted layer with Quartz. I have an implementation
using CATiledLayers but it doesn't add speed in common cases.

At this point, large images still draw significantly slower than in
Preview. For example, I can display a 25MB test JPEG (~9k x 9k pixels)
in ~2 seconds while Preview can display it in ~1 second on the same
machine. I can display a 12MB raw (~4k x 3k) in ~2.5 seconds while
Preview can display it in less than 1 second.

In my code, almost all that time is spent in CGContextDrawImage() —
not something I can optimize.

Looking at rendering the test JPEG in Instruments, I can see that
Preview's call tree is largely the same as my call tree except that
Preview uses some sort of custom tiling.

Looking at the rendering the test raw in Instruments, the primary
difference is that my code calls a specific RawCamera function three
times more than Preview calls it. What this means, I don't know.

I've combed the documentation, the internet, and the list archives
pretty thoroughly and I feel like I'm about out of things to try. Can
anyone give me advice or leads?

Thanks
_______________________________________________

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

  • Prev by Date: Problems with runModalForWindow, looking for alternatives
  • Next by Date: Re: Is NSDateFormatter thread-safe?
  • Previous by thread: Re: Problems with runModalForWindow, looking for alternatives
  • Index(es):
    • Date
    • Thread