Repository: flutter
Issue: Blinking cursor should use less CPU
Labels: platform-ios,c: performance,platform-mac,platform-linux,a: desktop,perf: memory,has reproducible steps,P2,found in release: 1.20,found in release: 2.2,found in release: 2.4,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a performance problem, then fill our the template below.
     Please read our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Details

I noticed that this issue has been raised in regards to ios, but this is on macos and that issue is also locked now. https://github.com/flutter/flutter/issues/33833

Using an animated widget, such as TextField (when the cursor is blinking) causes cpu usage to remain steadily at 6-10% in the mac activity monitor. I'm on a 2019 15" MBP. Submitting the field (and therefore ending the animation) sees a return to 0% cpu usage.

To reproduce, just display a TextField.

As a side note, memory usage sits between 200-300MB for a relatively simple app. Loading larger widgets such as large amounts of text (not rich text) causes memory to spike as much as 50-70MB.

I'm on flutter master, but this issue occurs on every version I've tried.

<!--
1.  Please tell us exactly how to reproduce the problem you are running into, and how you measured the performance.

2.  Please attach a small application (ideally just one main.dart file) that
     reproduces the problem. You could use https://gist.github.com/ for this.

3.  Switch flutter to master channel and run this app on a physical device
     using profile or release mode. Verify that the performance issue can be
     reproduced there.

     The bleeding edge master channel is encouraged here because Flutter is
     constantly fixing bugs and improving its performance. Your problem in an
     older Flutter version may have already been solved in the master channel.
-->

<!--
     Please tell us which target platform(s) the problem occurs (Android / iOS / Web / macOS / Linux / Windows)
     Which target OS version, for Web, browser, is the test system running?
     Does the problem occur on emulator/simulator as well as on physical devices?
-->

**Target Platform:** 

MacOS

**Target OS version/browser:** 

Catalina 10.15.1 (19B88)

**Devices:** 

MacBook Pro

## 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.
-->

```
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:40:20 • override_on_non_overriding_member
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:49:20 • override_on_non_overriding_member
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:58:20 • override_on_non_overriding_member
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:63:20 • override_on_non_overriding_member
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:68:20 • override_on_non_overriding_member
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:77:20 • override_on_non_overriding_member
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:86:20 • override_on_non_overriding_member
   info • The getter doesn't override an inherited getter • lib/bloc/active_requests_bloc.dart:93:20 • override_on_non_overriding_member
   info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: RequestModel.id • lib/bloc/models.dart:16:7 •
          must_be_immutable
   info • Close instances of `dart.core.Sink` • lib/header_bar.dart:12:9 • close_sinks
   info • Close instances of `dart.core.Sink` • lib/request_container.dart:36:9 • close_sinks
   info • Close instances of `dart.core.Sink` • lib/request_container.dart:111:9 • close_sinks

```

<!-- Finally, paste the output of running `flutter doctor -v` here, with your device plugged in. -->

```
[✓] Flutter (Channel master, 1.20.0-1.0.pre.25, on Mac OS X 10.15.1 19B88, locale en-US)
    • Flutter version 1.20.0-1.0.pre.25 at /Users/ben/.local/lib/flutter
    • Framework revision 3744b82d8c (17 hours ago), 2020-06-11 13:25:01 -0700
    • Engine revision 965fbbed17
    • Dart version 2.9.0 (build 2.9.0-14.0.dev 2b917f5b6a)

[✗] 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/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT 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.9.3

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 46.0.3
    • Dart plugin version 201.7846.93

[✓] VS Code (version 1.46.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.11.0

[✓] Connected device (1 available)
    • macOS • macOS • darwin-x64 • Mac OS X 10.15.1 19B88

! Doctor found issues in 2 categories.
```