On Dec 11, 2013, at 9:53 AM, Steve Sisak <sgs-li...@codewell.com> wrote: > Not to hijack the thread, but I'm just getting head into optimizing some code > which displays live preview for a number of JPEG streams simultaneously. > > Most implementations I've tried result in being CPU bound in JPEG code on the > main thread with the 7 other cores idle. > > I've tried variants of NSImageView, CGImage and CIImage and all that's needed > to render them on alternate threads but Cocoa appears to so good at delaying > evaluation as long as possible that it seems to end up calling the JPEG > decoder synchronously from -drawRect of whatever view subclass I've chosen on > the main thread.
Simple attempt: when you get the JPEG, create a CGBitmapContext on a background thread and draw the JPEG into it. Then use the CGBitmapContext to draw on the main thread. -- Greg Parker gpar...@apple.com Runtime Wrangler _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com