Almost a full second of first-frame jank when resuming app on macos with automatic graphics switching enabled #116499
Labels
a: desktop
Running on desktop
c: performance
Relates to speed or footprint issues (see "perf:" labels)
found in release: 3.3
Found to occur in 3.3
found in release: 3.7
Found to occur in 3.7
has reproducible steps
The issue has been confirmed reproducible and is ready to work on
P2
Important issues not at the top of the work list
perf: energy
Performance issues related to energy use (power, watts)
platform-mac
Building on or for macOS specifically
team-desktop
Owned by Desktop platforms team
triaged-desktop
Triaged by Desktop platforms team
Details
Example app:
Setup:
Ensure "Automatic graphics switching" is enabled in MacOS battery preferences (it is by default)
Reproduction steps:
Run the app with
flutter run --profile
(in the attached traces, I also used--trace-skia
)Open flutter dev tools
Maximize the app
Switch to flutter dev tools via three fingered swipe
View a trace (it seems like there must be some activity happening while the flutter app is in the background, but it certainly doesn't have to be flutter dev tools)
Switch back to the flutter app
Switch back to flutter dev tools and view the frame with jank
(repeat as desired)
Expected result:
The first frame upon switching to the flutter app does not have jank
Actual result:
The first frame takes 950+ms, with the bulk of the time taken up by
FlutterCompositorCreateBackingStore
As suggested in #99846, I tried setting enabling
NSSupportsAutomaticGraphicsSwitching
in macos/Runner/info.plist, but it had no effect.In the attached trace:
Starting at frame 9, each frame represents switching to the flutter app.
The frames that are under 17ms represent times I switched away from the app but switched back to it before doing much in any other app.
The frames that are over 900ms represent times I did something in another app in between - such as loading a new trace in dart dev tools
dart_devtools_2022-12-04_23_51_03.813.json.zip
Target Platform: MacOS (x86)
Target OS version/browser: 12.5
Devices: 16 inch 2019 macbook pro
Logs
Logs
Analyzing resume_jank.dart...
No issues found! (ran in 1.1s)
[✓] Flutter (Channel master, 3.7.0-2.0.pre.38, on macOS 12.5 21G72 darwin-x64, locale en-US)
• Flutter version 3.7.0-2.0.pre.38 on channel master at /usr/local/Caskroom/flutter/2.10.2/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18534a8 (7 hours ago), 2022-12-04 17:44:35 -0500
• Engine revision 359a0a979a
• Dart version 2.19.0 (build 2.19.0-444.0.dev)
• DevTools version 2.20.0
[✗] 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, please use
flutter config --android-sdk
to update to that location.[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] 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).
[✓] VS Code (version 1.73.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.54.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.5 21G72 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.94
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories.
The text was updated successfully, but these errors were encountered: