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

ngInfiniteScroll causes high CPU usage on Cordova Android app #368

Open
gkimpson opened this issue Sep 1, 2017 · 0 comments
Open

ngInfiniteScroll causes high CPU usage on Cordova Android app #368

gkimpson opened this issue Sep 1, 2017 · 0 comments

Comments

@gkimpson
Copy link

gkimpson commented Sep 1, 2017

I have a Cordova Angular application running on a Android 7.x device (onePlus 3 - so a relatively new device) and have a ng-repeat used inconjunction with ngInfiniteScroll to show a users 'news feed'.

Viewing the Android Monitor in Android Studio I can see the User CPU usage hovers around 20-30% even when the user is not actively doing anything in the app, when I remove the infinityScroll code this drops to 0-1% right away. The issue causes the app to hang after 2-3 minutes of usage (and becomes unusable & user most close the app to use it again), however without the infinity scroll code the app CPU usage is low and no longer hangs the app.

<div infinite-scroll="tabs[tabIndex].FeedService.loadFeed(false, tabs[tabIndex].FeedService.filters, search.text, search.dateFrom, search.dateTo)" infinite-scroll-disabled="tabs[tabIndex].FeedService.busy || tabs[tabIndex].FeedService.noMoreResults || !tabs[tabIndex].active || tabs[tabIndex].FeedService.initialLoad" infinite-scroll-distance="1" infinite-scroll-immediate-check="false" > <div ng-repeat="interaction in getTabItems(tabIndex) track by $index"> -- rest of html code is not shown here--

Can anyone suggest how best to optimise ngInfiniteScroll so it uses less CPU usage - on desktop this is phone, but within a mobile webview (which is a lot less powerful) it seems to struggle a lot after a few minutes.

Using the following:
Cordova 7.0.1
Angular 1.3.0
ngInfiniteScroll 1.2.2

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

1 participant