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

Slow performance in collection view cell #22

Open
gianfilippocisternino opened this issue Aug 23, 2017 · 2 comments
Open

Slow performance in collection view cell #22

gianfilippocisternino opened this issue Aug 23, 2017 · 2 comments

Comments

@gianfilippocisternino
Copy link

I am using this ring progress view inside a collection view.
When i start scrolling the collection view and the collection view creates another cell, it is not smooth.
I used instruments to see what could be the problem and i noticed that the heaviest function was the method contentImage in the MKRingProgressView class.

Can you please try to see if is there any way to improve performance?
Thank you

@maxkonovalov
Copy link
Owner

Hello @gianfilippocisternino
This control was never intended to be used in performance-critical cases like the one you described, sorry. The control's implementation depends on a gradient image generating, which is a really heavy operation. You can read more here: https://github.com/maxkonovalov/MKGradientView#performance
One way to fix this could be a caching mechanism for generated gradient images.
Another workaround might be to disable the gradient altogether, leaving only solid color for the rings, but this tradeoff should give a big performance boost, because it would also allow some more optimizations to be made.
I'll try to do something with this issue some time in the future, but not quite soon I think...
If you make some fixes for this yourself, feel free to submit a pull request, it would really help.

@maxkonovalov
Copy link
Owner

@gianfilippocisternino I added some optimizations to the control's drawing, please see https://github.com/maxkonovalov/MKRingProgressView#performance for more details.
Let me know if it helped!

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