Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulator vs. device performance #25

Open
HarshilShah opened this issue Sep 25, 2017 · 8 comments
Open

Simulator vs. device performance #25

HarshilShah opened this issue Sep 25, 2017 · 8 comments

Comments

@HarshilShah
Copy link
Contributor

I'm trying to use the example application with the Xcode 9 and iOS 11 GMs here, and seeing significant performance differences between the two.

On my mid-2014 15-inch MacBook Pro, the example app absolutely flies, working perfectly, pretty much. Meanwhile, on my 6s Plus, it's dropping frames left, right, and centre. I tried messing with the usual suspects (clear memory, low power mode, etc.) but device just keeps dropping frames.

I know there's a performance difference between simulator and device, but it usually tends to be in the device's favour, especially with graphics stuff. There's also an OpenGL simulator bug in the GM, which might be at play here: https://twitter.com/xenadu02/status/911463433521860609

Any ideas for increasing on device performance? I tried but can't seem to find any way to toggle CPU-based rendering like with CIContext, for example.

Thanks

@maxkonovalov
Copy link
Owner

Hey @HarshilShah, thanks for pointing this out! There used to be a performance issue with generating the gradient image, but I'm not sure if it could affect the frame rate so much. Can you check if you have the same issue on a Release config?
More info here - https://github.com/maxkonovalov/MKGradientView#performance

@HarshilShah
Copy link
Contributor Author

Hey there, thanks for the quick reply!

I tried using a release config as well, but there isn't much of a difference. Gradient generation is a slow thing, but at least in the example app it only happens once, at load. It's the drawing operations after that that seem to be the cause of the issue

@maxkonovalov
Copy link
Owner

Yup, looks like a CPU-bound issue then, as everything is drawn using CGContext. Definitely need to profile and optimize that. Don't know when I can get my hands on it though, so if you have any ideas about fixing it, any help would be appreciated!
Btw I tested the demo on a iPhone 7+ device with iOS 11 and the performance was not bad at all.

@HarshilShah
Copy link
Contributor Author

Yup, I’ve got a couple of ideas I’ll be trying. Also I do need to upgrade my phone 😅

Sent with GitHawk

@HarshilShah
Copy link
Contributor Author

Btw, here’s what it looks like on my end. Kinda surprised iOS screen recording works even when there isn’t even enough perf to render frames in time, but this is exactly what I’m seeing:
ScreenRecording_09-25-2017 15:04.MP4.zip

(Zipped because GitHub doesn't support .mp4)

@maxkonovalov
Copy link
Owner

Thanks for posting the video! I thought the issue was much worse actually))

@HarshilShah
Copy link
Contributor Author

It gets worse with progress, basically. More than one rotation of any ring makes it way worse

@maxkonovalov
Copy link
Owner

Hi @HarshilShah, I updated the lib with some optimizations - can you please check v2.0 and let me know if the performance improved for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants