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

Optimise scrolling with PostLayoutListener by using object pools #38

Open
Kisty opened this issue Jan 16, 2017 · 1 comment
Open

Optimise scrolling with PostLayoutListener by using object pools #38

Kisty opened this issue Jan 16, 2017 · 1 comment

Comments

@Kisty
Copy link

Kisty commented Jan 16, 2017

Love this lib! It's brilliant!

Every time a scroll occurs, ItemTransformation objects are created per view per scroll. This use of creating many ItemTransformation objects a lot of the time, it makes the GC fire off many times and therefore, you see jank. If an object pool is used, it would mean that the GC won't be fired constantly.

This would look something like adding a method to ItemTransformation.obtain(scaleX,scaleY,translationX,translationY) and using an object pool internally to get objects. Then once it's been used, just call release method on object and that tells the system it can be recycled.

Colt McAnlis explains the concept here: https://www.youtube.com/watch?v=bSOREVMEFnM

What do you think? Is it something worth exploring?

@mig35
Copy link
Member

mig35 commented Jan 20, 2017

Hi @Kisty, again :). As I told before I'll try to find some free time to solve this issue, but I'm not sure when.
Best wishes, Mike.

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