Repository: flutter
Issue: Performance: FPS Drops dramatically with 4k+ particles. (Desktop - Darwin)
Labels: engine,c: performance,platform-mac,platform-windows,c: rendering,a: desktop,has reproducible steps,P3,found in release: 3.19,found in release: 3.20,team-macos,triaged-macos

## Details

I have been testing Flutter to evaluate its rendering capabilities. Because I intend to create a Graph viewer That needs to deal with millions or billions of nodes, with colors, movements, arrows and so on. Browser applications using Canvas or OpenGL works well. But I believed Flutter would be even better because it claims to tend to be "native". My experience says otherwise. Or maybe I'm not doing it correctly.

I tested Flame engine, I did a test with Flutter-Particles which uses Flutter canvas painting (Almost all animations I found about flutter used it) and all the other tests I did were using the same painting canvas. The last one I've tested was the gskinnerTeam's "Guide To the Stars Particles". That one is perfect an easy one to reproduce. And beautiful.

All tests were similar. All of them worked well below 1k. They started to degrade from 3k and visibly bad from 4k above. 30k of particles is impossible to deal.

I used Perf Overlay to analyze it.

I thought of creating a practical example myself, but from the simple tests I found, I came across performance issues - So I could not do anything better than what is already done. And I have two Macs. A Macbook pro 18 and a MacMini 17. Both had similar performance and could not handle above 5k ~ 30k.

That's all I have. Maybe add support for API GPU for direct access by frameworks like Flame. Or even check if is true that this rendering uses a single thread and make it work with more. Dunno.

Cheers.

## To reproduce it

UPDATE: Use this example https://dartpad.dartlang.org/40308e0a5f47acba46ba62f4d8be2bf4
increase the number of disks in child: VariousDiscs. Above 500 starts to decrease performance.

Clone flutter_vignettes repo and use this example https://github.com/gskinnerTeam/flutter_vignettes/tree/master/vignettes/constellations_list

In main.dart
```
import 'package:flutter/foundation.dart'
    show debugDefaultTargetPlatformOverride;

import 'demo.dart';

void main() {
  // See https://github.com/flutter/flutter/wiki/Desktop-shells#target-platform-override
  debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;

  runApp(new App());
}
```
>and of course add the macos folder.

And done.

To add more particles, go to demo.dart and go to the line 70 and change it
```
    int starCount = 5000;
```

Let it run. Go increasing the amount of particle. And check the perf overlay. Also, you can use the XCode debug analyzer and see that it seems to be using a single thread. In there we can't see the GPU usage, but let's trust the Flutter overlay for this.

More context.
Conversation with the Flame guys https://github.com/flame-engine/flame/issues/149
My first suspect was this https://github.com/flutter/flutter/issues/32569

**Target Platform:** MacOS Mojave.
**Target OS version/browser:** Mojave 10.14.6 
**Devices:** Desktop

Running Flutter in the master channel.

## Logs

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
[✓] Flutter (Channel master, v1.13.1-pre.76, on Mac OS X 10.14.6 18G95, locale pt-BR)
    • Flutter version 1.13.1-pre.76 at /Users/micheldiz/flutter
    • Framework revision d0526d3f92 (2 days ago), 2019-12-09 18:58:29 -0800
    • Engine revision b9080c92b9
    • Dart version 2.7.0 (build 2.7.0-dev.2.1 8b8894648f)

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_HOME to
      that location.
      You may also want to add it to your PATH environment variable.


[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B500
    • CocoaPods version 1.8.4

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).

[✓] VS Code (version 1.40.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.7.1

[✓] Connected device (1 available)
    • macOS • macOS • darwin-x64 • Mac OS X 10.14.6 18G95
```