Repository: flutter
Issue: Performance and Crashing with InteractiveViewer Widget on flutter web/mobile web.
Labels: c: crash,engine,c: performance,platform-web,has reproducible steps,P2,found in release: 3.7,found in release: 3.9,team-web,triaged-web

@justinmc would you mind taking a look at scale and pan performance on web / mobile web, especially when text is used? May even be an opportunity for a test/benchmark. I used statsfl (https://pub.dev/packages/statsfl) (to easily benchmark across mobile and desktop web browsers), your above column/row example, and added an appbar to increase the row/column count and disable/enable text.

On chrome mobile, LG G7 ThinQ, issues are immediately apparent with text enabled and a crash can instantly be induced by scaling. FPS issues with scroll and scale start around 75x75 if text is disabled, jank is severe around 150x150, and crash prone around 300x300.

On chrome with my decently specced PC, an FPS drop can be seen immediately when scrolling with text enable, but scaling can maintain 60fps. At 10x10 scaling performance is impacted, severe at 20x20, and crash prone on anything above 30x30. Without text performance issues start at 20x20, but the issue does not become severe until over 100x100.


## Steps to Reproduce

Click/tap the buttons on the app bar to increase the column/row count, disable/enable text, or disable/enable color.

`pubspec`
add for easy fps
`  statsfl: ^1.0.0+2`

`main`
```
import 'package:flutter/material.dart';
import 'package:statsfl/statsfl.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          // This is the theme of your application.
          //
          // Try running your application with "flutter run". You'll see the
          // application has a blue toolbar. Then, without quitting the app, try
          // changing the primarySwatch below to Colors.green and then invoke
          // "hot reload" (press "r" in the console where you ran "flutter run",
          // or simply save your changes to "hot reload" in a Flutter IDE).
          // Notice that the counter didn't reset back to zero; the application
          // is not restarted.
          primarySwatch: Colors.blue,
          // This makes the visual density adapt to the platform that you run
          // the app on. For desktop platforms, the controls will be smaller and
          // closer together (more dense) than on mobile platforms.
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        home: StatsFl(
          isEnabled: true,
          child: MyHomePage(title: 'Flutter Demo Home Page'),
        ));
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _rowCount = 5;
  int _columnCount = 5;
  bool _text = true;
  bool _color = true;

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        title: Text("Column: $_columnCount\nRow: $_rowCount"),
        actions: [
          IconButton(
              icon: Icon(Icons.add),
              onPressed: () {
                setState(() {
                  _rowCount += 5;
                  _columnCount += 5;
                });
              }),
          IconButton(
              icon: Icon(Icons.format_paint),
              onPressed: () {
                setState(() {
                  _color = !_color;
                });
              }),
          IconButton(
              icon: Icon(Icons.text_fields),
              onPressed: () {
                setState(() {
                  _text = !_text;
                });
              })
        ],
      ),
      body: InteractiveViewer(
          scaleEnabled: true,
          panEnabled: true,
          constrained: false,
          child: Table(
            columnWidths: <int, TableColumnWidth>{
              for (int column = 0; column < _columnCount; column++)
                column: const FixedColumnWidth(300.0),
            },
            children: <TableRow>[
              for (int row = 0; row < _rowCount; row++)
                TableRow(
                  children: <Widget>[
                    for (int column = 0; column < _columnCount; column++)
                      Container(
                          child: _text
                              ? Text("Column: $_columnCount\nRow: $_rowCount")
                              : null,
                          height: 100,
                          color: _color
                              ? row % 2 + column % 2 == 1
                                  ? Colors.red.withOpacity(0.5)
                                  : Colors.green.withOpacity(0.5)
                              : null),
                  ],
                ),
            ],
          )),
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
```

```
 Doctor found issues in 1 category.

[√] Flutter (Channel master, 1.20.0-1.0.pre.90, on Microsoft Windows [Version 10.0.17758.4], locale en-US)
    • Flutter version 1.20.0-1.0.pre.90 at C:\src\flutter
    • Framework revision 42e02d60d3 (23 hours ago), 2020-06-17 10:57:40 -0700
    • Engine revision 965fbbed17
    • Dart version 2.9.0 (build 2.9.0-14.0.dev 2b917f5b6a)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at C:\Users\Miche\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.46.0)
    • VS Code at C:\Users\Miche\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.11.0

[√] Connected device (2 available)
    • Web Server • web-server • web-javascript • Flutter Tools
    • Chrome     • chrome     • web-javascript • Google Chrome 83.0.4103.106
```

edit: added counts to title