Skip to content

Tableview widget janks execessively with >250k rows #138271

Closed
flutter/packages
#10738

Description

@ChuckPG

Is there an existing issue for this?

Steps to reproduce

  1. Update the example app in the 2d-scrollables package to start with 1.5 million rows by editing int _rowCount = 1500000;
  2. Run the app flutter run -d mac --release
  3. Click the "Jump to bottom"
  4. Attempt to scroll

Expected results

Scroll without janking

Actual results

Getting ~1 frame every 1-2 seconds

Code sample

Update the example app in the 2d-scrollables package to start with 1.5 million rows by editing int _rowCount = 1500000;

Screenshots or Video

Screenshots / Video demonstration
large.row.count.mov

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.13.9, on macOS 14.1 23B74 darwin-arm64, locale
    en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    ✗ Unable to get list of installed Simulator runtimes.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.84.0)
[✓] Connected device (2 available)
[✓] Network resources

Activity

  1. ChuckPG commented on Nov 11, 2023

    @ChuckPG
    Author

    Love the package thank you!

    I was hopeful that supporting large sets of rows would come with lazy loading nature of the package, as Android or iOS virtualizing views do. However, scrolling performance degrades in the lower rows in the table.

  2. kswoll commented on Nov 11, 2023

    @kswoll

    +1 this is a great package!

    I notice that when you scroll from the bottom, _reifyChildren appears to get called on every animation frame. It has this implementation:

    for (int minorIndex = _leadingYIndex!; minorIndex <= _trailingYIndex!; minorIndex++) {
      // Major
      for (int majorIndex = _leadingXIndex!; majorIndex <= _trailingXIndex!; majorIndex++) {
        final ChildVicinity vicinity = ChildVicinity(xIndex: majorIndex, yIndex: minorIndex);
        previousChild = _completeChildParentData(
          vicinity,
          previousChild: previousChild,
        ) ?? previousChild;
      }
    }
    

    If you're at the bottom of a 1.5 million row table, _leadingYIndex is zero, _trailingYIndex is 1,499,999 and the leading and trailing X values is 0 and 5. (for my table)

    This means that while scrolling, 100s of millions of iterations of these loops is firing.

  3. added
    in triagePresently being triaged by the triage team
    on Nov 13, 2023
  4. huycozy commented on Nov 13, 2023

    @huycozy
    Member

    Thanks for the report. Reproduced this issue on Android and macOS platforms in profile mode.

    After clicking on "Jump to bottom" button, there are a lot of janks:

    Janks observation demo video (macOS)
    Screen.Recording.2023-11-13.at.12.40.18.mov

    Timeline trace json file: dart_devtools_2023-11-13_12_41_23.152.json

    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.13.9, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.13.9 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision d211f42860 (11 days ago), 2023-10-25 13:42:25 -0700
        • Engine revision 0545f8705d
        • Dart version 3.1.5
        • DevTools version 2.25.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
        • Xcode at /Users/huynq/Downloads/Xcode.app/Contents/Developer
        • Build 15A507
        • CocoaPods version 1.13.0
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.3)
        • Android Studio at /Applications/Android Studio Giraffe.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.84.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.76.0
    
    [✓] Connected device (4 available)
        • RMX2001 (mobile) • EUYTFEUSQSRGDA6D                         • android-arm64  • Android 11 (API 30)
        • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.7.9 19H365
        • macOS (desktop)  • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 118.0.5993.117
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    [!] Flutter (Channel master, 3.17.0-5.0.pre.64, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.17.0-5.0.pre.64 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 2e088178e8 (4 hours ago), 2023-11-12 18:45:26 -0500
        • Engine revision a18ee3c7f5
        • Dart version 3.3.0 (build 3.3.0-120.0.dev)
        • DevTools version 2.30.0-dev.1
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15A507
        • CocoaPods version 1.13.0
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.3)
        • Android Studio at /Applications/Android Studio Giraffe.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    
    [!] Android Studio (version unknown)
        • Android Studio at /Applications/Android Studio Preview.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        ✗ Unable to determine Android Studio version.
        • Java version OpenJDK Runtime Environment (build 17.0.8+0-17.0.8b1000.22-10799086)
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.84.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.76.0
    
    [✓] Connected device (3 available)
        • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64  • Android 11 (API 30)
        • macOS (desktop)  • macos            • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)     • chrome           • web-javascript • Google Chrome 119.0.6045.123
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 2 categories.
  5. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    f: scrollingViewports, list views, slivers, etc.
    packageflutter/packages repository. See also p: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    p: two_dimensional_scrollablesIssues pertaining to the two_dimensional_scrollables package
    and removed
    in triagePresently being triaged by the triage team
    on Nov 13, 2023
  6. added
    P2Important issues not at the top of the work list
    on Nov 14, 2023
  7. MattyBoy4444 commented on Feb 12, 2025

    @MattyBoy4444

    Any update?

  8. wangfeihang commented on Jan 9, 2026

    @wangfeihang
    Contributor

    Hi everyone! I've submitted a PR try to optimizes this jank. You can check it out here:
    #180563
    #10738

  9. github-actions commented on Feb 5, 2026

    @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.

  10. locked as resolved and limited conversation to collaborators on Feb 5, 2026
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

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)f: scrollingViewports, list views, slivers, etc.found in release: 3.13Found to occur in 3.13found in release: 3.17Found to occur in 3.17frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: two_dimensional_scrollablesIssues pertaining to the two_dimensional_scrollables packagepackageflutter/packages repository. See also p: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions