-
Notifications
You must be signed in to change notification settings - Fork 151
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
renderQueue? #27
Comments
The render queue assures that the cells are rendered synchronously, in order, and with the highest priority. The threading assures the app is free to do whatever it needs with as little possible interruption from the grid. We noticed a moderate performance increase with this. |
I'd like more discussion on this. At first glance, Peter appears to be right, since sending UIKit messages on a thread other than the main thread is documented as a no-no. |
This queue is on the main thread AFAIK otherwise the UI wouldn't update at all. |
Sounds reasonable. Can you find it documented that serial queues execute on the main thread? Edit: Unless you find something to the contrary, I don't think it's actually guaranteed that serial queues will execute on the main thread. Hence, to be safe, we probably ought to wrap all UIKit updates in |
I'll ask Indragie. I got the idea from him. |
Still, i'm not convinced that there's any advantage in using such a queue. Performance-wise, all it should bring is a slightly speed loss, GCD is fast, but there's still some overhead. |
Only way to find out is to test. The reason we're using a queue in the first place is that @kolinkrewinkel believed that it resulted in a net speed increase when he tried it. If that's no longer the case, it should be excised. |
I think what the queue does is bundling all the update actions and put it at the end of the main runloop. I may be wrong though... |
No, it doesn't. If you use dispatch_sync, it's executed right within the code flow. |
Hi guys,
i finally have time to look into KKGridView, and already found/working on some issues.
I'm curious, what's the reasoning behind renderQueue and the dispatch_sync? (_layoutGridView, KKGridView.mm)
I've never seen such a pattern - AFAIK you're not allowed to make UIKit-changes except in the main thread, so we're already guaranteed that no two render operations run at the same time. Am I overlooking sth?
The text was updated successfully, but these errors were encountered: