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

perf: Infinite scroller is hogging too much power #5776

Closed
ErkoKnoll opened this issue Mar 9, 2016 · 4 comments
Closed

perf: Infinite scroller is hogging too much power #5776

ErkoKnoll opened this issue Mar 9, 2016 · 4 comments
Assignees
Milestone

Comments

@ErkoKnoll
Copy link

Type: perf

Ionic Version: 2.x

Platform: android 5.1 webview

I have a case when the infinite scroller is enabled (can still be scrolled) then it is causing noticeable lag for SVG or Canvas renderings.

When the scroller has been disabled or removed then the lag is gone. I'm using http://leafletjs.com/ for maps and when the page that is not on top of the stack has infinite scroller that is enabled then panning and zooming the map on the active is very laggy. And each time when either the scroller is disabled or not added to DOM then there is no lag.

May I suggest also to disable infinite scroller internal workings if the page that it is attached to is not in the top of the view stack, because for me the infinite scroller is not in the active page but is still causing heavy lag for other pages.

Here is the scroller code im using:

<ion-infinite-scroll *ngIf="invisibleEmployees.length > 0" (infinite)="doInfinite($event)" threshold="20%"> <ion-infinite-scroll-content></ion-infinite-scroll-content> </ion-infinite-scroll>

@adamdbradley
Copy link
Contributor

Good call, I'll take a look into this. Right now the scroller is opacity: 0 so it can quickly be shown. But probably the better route is to have it completely display none. Thanks!

@adamdbradley adamdbradley self-assigned this Mar 9, 2016
@adamdbradley adamdbradley added this to the 2.0.0-beta.5 milestone Mar 9, 2016
@ErkoKnoll
Copy link
Author

It indeed seems to be the spinner animation that is causing the lag. If I removed the spinner and added text instead as following then everything was really smooth.
loadingSpinner="none" loadingText="Loading more data..."

@adamdbradley
Copy link
Contributor

Cool, good to know. Yeah animating that SVG in the background must be causing the issue, thanks for the report.

adamdbradley added a commit that referenced this issue Mar 13, 2016
By default the SVG spinner should be display none at all times. Only
display block the SVG when the infinite scroll is in the loading state.

Closes #5776
@adamdbradley
Copy link
Contributor

I made a fix that by default the SVG will be display none, and only display block during the loading state. Please let us know if you're still having issues, thanks!

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants