Skip to content

Blinking cursor should use less CPU #59327

@Blquinn

Description

@Blquinn

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

Target Platform:

MacOS

Target OS version/browser:

Catalina 10.15.1 (19B88)

Devices:

MacBook Pro

Logs

   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

[✓] 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopc: performanceRelates to speed or footprint issues (see "perf:" labels)found in release: 1.20Found to occur in 1.20found in release: 2.2Found to occur in 2.2found in release: 2.4Found to occur in 2.4has reproducible stepsThe issue has been confirmed reproducible and is ready to work onperf: memoryPerformance issues related to memoryplatform-iosiOS applications specificallyplatform-linuxBuilding on or for Linux specificallyplatform-macBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions