Skip to content

Very slow Ionic list/item rendering #1107

Closed

Description

@ptitjes

Stencil version:

@ionic/[email protected]
└── @stencil/[email protected] 

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

The rendering of ion-list/ion-items is very slow. It seems that many re-layouts are triggered as part of the list rendering. As a result, the rendering takes almost 1.5 second for a very simple list of 200 items:

    <ion-list>
      <ion-item *ngFor="let item of items$ | async">
        <ion-label>{{ item.title }}</ion-label>
      </ion-item>
    </ion-list>

Note that the first rendering is hidden through the use of a hydrated CSS class (with opacity: 0; style) but the rendering is as long.

Expected behavior:

I would expect that the rendering to be as fast as Ionic v3 or at least in the same order of magnitude.

I know that Ionic 4 is currently in beta. However, I would expect that we test a rendering behavior that is as close as possible to what we will in the final version. So I believe the current behavior is not intended and is a bug.

Steps to reproduce:

  1. open the StackBlitz mentioned bellow
  2. click on the "Reload" button in the header bar of demo
  3. observe the scrollbar shrinking as the new list content is re-layout multiple times

Related code:

A StackBlitz showing the behavior (with Ionic 4.0.0-beta.7 as StackBlitz does not play well with the loader):
https://stackblitz.com/edit/angular-ionic-v4-slow-lists

The exact same code (modulo imports, ...) on Ionic 3:
https://stackblitz.com/edit/angular-ionic-v3-fast-lists

Other information:

A screenshot showing the Chrome performance view for the v4 version:
screenshot showing the Chrome performance view for the v4 version

A screenshot showing the Chrome performance view for the v3 version:
screenshot showing the Chrome performance view for the v3 version

Activity

  1. changed the title [-]Very slow Ionic `ion-list/ion-item` rendering[/-] [+]Very slow Ionic Ionic list/item rendering[/+] on Sep 23, 2018
  2. changed the title [-]Very slow Ionic Ionic list/item rendering[/-] [+]Very slow Ionic list/item rendering[/+] on Sep 23, 2018
  3. ptitjes commented on Sep 23, 2018

    @ptitjes
    Author

    I was wrong when saying:

    Note that the first rendering is hidden through the use of a hydrated CSS class (with opacity: 0; style) but the rendering is as long.

    The rendering of the list is done in one shot at the page load.

  4. mcelotti commented on Jan 16, 2019

    @mcelotti

    Overall ux seems to improve by overriding window.requestAnimationFrame (like suggested in referenced issue)

  5. ptitjes commented on Jan 16, 2019

    @ptitjes
    Author

    I believe it was somehow fixed in latest versions. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions