adamwulf / loose-leaf

Intuitive note taking app. Import and annotate PDFs, manipulate imported photos with intuitive gestures, and take notes with Apple Pencil.
https://getlooseleaf.com
MIT License
620 stars 95 forks source link

super slow in iPad 3 Retina iOS 9 #1737

Open ghost opened 7 years ago

ghost commented 7 years ago

The draw is super slow, and the undo/redo it's impossible use. Very laggy. Do you know why this happens ?

adamwulf commented 7 years ago

not sure - I haven't had any reports of this until now. Is this when you build from source, from the app store, or both?

ghost commented 7 years ago

From the source. It's unusable. I can make a video if you want.

adamwulf commented 7 years ago

yeah, a video would be great. Also using the Profiler and seeing where all that time is being spent. Unfortunately I sold my iPad 3 a while ago so I won't be able to repro myself.

ghost commented 7 years ago

I'll upload it later 👍

ghost commented 7 years ago

Here's a quick example, it starts lagging up when I undo.

If I have photos or crops, it stays as the end of the video, super laggy :/

IMG_0244-1.mp4.zip

adamwulf commented 7 years ago

I'd be interested in what the Profiler instrument says is going on. I wonder if its maxing out the CPU and lagging b/c of that, or if CPU is relatively low throughout and it's the GPU getting slammed.

If the Profiler doesn't show anything obvious as the bottleneck, the only option might be to swizzle the [scale] method on UIScreen to return 1 instead of 2. That'd lower the pixels used to 1/4 what it's trying to process now, which I suspect would speed things up considerably. That should be an easy way to get performance up without digging deeper into the root cause. Without access to an iPad 3 I think that's the best advice I can give :/

ghost commented 7 years ago

I deleted

dispatch_release(sema1); and so one, because xcode says it's ARC forbids, can be from it ?

adamwulf commented 7 years ago

That wouldn't cause it - it's fine to remove those lines. it's something w/ OpenGL, but i can't put my finger on it. i saw something similar ~ a year ago when I was working on iPad Pro support. It's very possibly related to #1551