Skip to content

Long TwoLevelLists have poor performance (due to lack of viewporting) #4765

Closed

Description

@eseidelGoogle

@abarth says @Hixie has some ideas how to do so.

An internal customer also hit this (bug id 29643185).

Activity

  1. Hixie commented on Jun 27, 2016

    @Hixie
    Contributor

    Said ideas are at #4430

  2. modified the milestone: on Sep 12, 2016
  3. added
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Sep 16, 2016
  4. self-assigned this
    on Sep 23, 2016
  5. modified the milestones: 2: Make Early Adopters happy, on Jan 31, 2017
  6. mehmetf commented on Mar 13, 2017

    @mehmetf
    Contributor

    Is this fixed with the addition of the new scrolling? I see we have viewporting in ListViews but not sure if TwoLevelLists do this yet.

  7. abarth commented on Mar 13, 2017

    @abarth
    Contributor

    Not fixed yet. The machinery is in place, just not used yet.

  8. modified the milestones: , 2: Make Early Adopters happy on Apr 11, 2017
  9. eseidelGoogle commented on Apr 11, 2017

    @eseidelGoogle
    ContributorAuthor

    Let us know if this is blocking you. Punting for now. We know how to do this if necessary and have the tools to do it now.

  10. removed their assignment
    on Apr 26, 2017
  11. HansMuller commented on May 12, 2017

    @HansMuller
    Contributor

    The app below contains 500 items, 100 of which are ExpansionTiles with 10 children. Scrolling performance on a Nexus 5 seems quite good to me, even after expanding sublists for a while. The ExpansionTiles are created lazily (ListView) and so, unlike TwoLevelList, only the visible ones are built or rendered.

    Let me know if this addresses the performance problem you reported. If so, I think we can close this issue.

    import 'package:flutter/material.dart';
    
    const int kItemCount = 500;
    const int kItemChildCount = 10;
    
    class ExpansionTilePerformance extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return new Scaffold(
          appBar: new AppBar(
            title: const Text('ExpansionTile'),
          ),
          body: new ListView.builder(
            itemCount: kItemCount,
            itemBuilder: (BuildContext context, int index) {
              final Widget title = new Text('Item $index');
              if (index % 5 == 0) {
                return new ExpansionTile(
                  title: title,
                  key: new ValueKey<int>(index),
                  children: new List.generate(kItemChildCount, (int childIndex) {
                    return new ListTile(title: new Text('  Item $index.$childIndex'));
                  }).toList(),
                );
              }
              return new ListTile(title: title);
            },
          ),
        );
      }
    }
    
    void main() {
      runApp(new MaterialApp(home: new ExpansionTilePerformance()));
    }
    
  12. mehmetf commented on May 12, 2017

    @mehmetf
    Contributor

    Yep this will work in the interim if we run into problems.

    However as we had talked, the best solution would be the FixedExtent solution with auto-derived extents.

  13. HansMuller commented on May 12, 2017

    @HansMuller
    Contributor

    Excellent, I'll close this issue. I'm working on adding support for auto-derived extents now.

  14. added a commit that references this issue on Apr 3, 2018
  15. added a commit that references this issue on May 14, 2018
  16. github-actions commented on Aug 17, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  17. locked as resolved and limited conversation to collaborators on Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: performanceRelates to speed or footprint issues (see "perf:" labels)f: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions