9

I just got the new iPad(3) and currently testing out a high resolution version of my drawing app that uses CoreGraphics.

In normal 1024x768 mode, the iPad is more or less similar in performance - with only a slight lag when drawing quickly.

But when I try painting on a high resolution canvas (2048x1536) the app becomes unusably slow and laggy. Is this because CoreGraphics are mostly calculated by the CPU (which I believe is not that much faster than the iPad2) and has to do 4x more work?

I have basically changed my drawing routine from

UIGraphicsBeginImageContext(CGSizeMake(1024, 768));

To

UIGraphicsBeginImageContextWithOptions(CGSizeMake(1024, 768), NO, 0.0);

To enable retina drawing, and the lines are super nice and crisp and images are saved out in 2048x1536. But as mentioned, the delay and lag is making it useless as a drawing tool.

Apart from rewriting my app in openGL (Not an option due to time constraints and earlier unsuccessful attempts at a critical blending mode), is there anything I can do to optimize a CoreGraphics app running in retina mode on the new iPad?

machineboy
  • 321
  • 3
  • 14
  • By 'larger canvas', do you mean the iOS simulator in Retina mode, or an actual iPad? – CodaFi Apr 13 '12 at 20:39
  • The performance issues may be more to do with how you are using CoreGraphics, rather than CG itself. There are some real snappy apps using retina on iPad, and I have not seen a huge impact. Maybe you could post how you are doing your drawing... without that, it will be hard to help much. – Jody Hagins Apr 14 '12 at 03:54
  • Basically I am stroking CGContextStrokePaths into a CGContextRef using kCGBlendModeDarken. As mentioned, in standard resolution the app flies on the iPad3 and the only thing I do is increase the resolution of the CGcontext swapping the line mentioned in my question. I've seen openGL-based apps like procreate that are really snappy, but I guess my question is more general on how CoreGraphics perform on the new iPad. – machineboy Apr 14 '12 at 05:59
  • Something very similar is happening to me, I'm drawing over a zoomable canvas. On previous iPads works amazingly fast, in the new iPad, if I start zooming in and out fast, the app sometimes crashes and sometimes the screen turns black with a small activity indicator in the middle. Really annoying. In both cases I have the same amount of paths rendered. – Omer Jul 10 '12 at 14:13
  • 1
    To me it seems that CoreGraphics in general is just very slow. I used it to draw some UI elements for tiles on a grid view, and got passable performance on non-retina iPad and iPhone, but much worse performance on the retina iPad. Every time I've run unto this issue, I've either given up and simplified the UI, or switched to OpenGL. Doesn't look like there's really a choice unless Apple fixes the framework. – Greg Mar 06 '13 at 04:57

1 Answers1

2

If the app is made by you and makes ur iPad slow, you should run test on it over Instruments that is part of xcode. I think it can help you find out the problem. I don't think ur iPad has malfunction or something like that.

Blade311
  • 33
  • 5
  • +1 for "run instruments". Specifically, I'd recommend time profiling it to see what's running slow and how to address it (may be different than what you think the cause is). – JRG-Developer Mar 11 '13 at 05:05