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

Preformance tips for large number of grids? #14

Open
daveeel opened this issue Aug 28, 2014 · 5 comments
Open

Preformance tips for large number of grids? #14

daveeel opened this issue Aug 28, 2014 · 5 comments

Comments

@daveeel
Copy link

daveeel commented Aug 28, 2014

Hi, I am trying to use the widget for a large number of grids.

Tested with about 150 grids with a local image (80x80) and a label for grid item. The rendering speed on device rotation almost freezes my "old" iPhone 4. On iPad Air, the speed is barely acceptable. I see 3-4 grids drawn per second. I tried your original sample by duplicating the sample data. It seems that image size and whether it's local or remote do not matter.

Ideally I wish to use the widget for about 200-300 grids.
So my question is: is there any way to increase the performance?

@prodz18
Copy link
Owner

prodz18 commented Aug 28, 2014

Hi. I think that right now the best solution is to show a limit of item (like 20-30) and add more items when the user scrolls to the end or adding a button at the end to load more items to the grid. The same thing could happen if you add like 300 rows to a table view or list view; that's why lazy loading or adding a add-more button is used for. I'll think of a better solution for this kind of situation.

@daveeel
Copy link
Author

daveeel commented Aug 28, 2014

Thanks for the prompt reply. So doesn't the current implementation already supports lazy adding?

@prodz18
Copy link
Owner

prodz18 commented Aug 28, 2014

Right now it doesn't have it right "out of the box", but it could be achieved using the addGridItems() function of the widget. You could have the array of 300+ items and add only the first 30 items. Then, you can add an "add-more button" at the end to push 30 more items to the grid or by using the scroll event and detect when the user is near the end of the scroll view.

@daveeel
Copy link
Author

daveeel commented Aug 28, 2014

Thanks. Shall try that. And hopefully the widget could add 'lazy adding' feature in future releases :)

@lithiumlab
Copy link

hi Pablo;
do you have an example somewhere how to detect scroll event is near the end?
i can't find one. thanks in advance.

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

No branches or pull requests

3 participants