Skip to content

Flutter App runs more slowly in Profile mode through the VS Code debugger compared to the terminal #3838

@eddiesTime

Description

@eddiesTime

Describe the bug
We've discovered during our work on RSA encryption that there are significant performance differences when running the app in profile mode via launch.json configuration compared to executing flutter run --profile in the terminal. It seems to us, that the IDE (VS Code) and the app believe they are in profile mode, device does not and restricts the performance as in debug mode.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/eddiesTime/profile_bug_example
  2. Click on clone the repository and set it up locally
  3. Connect a physical device to the computer
  4. Use the launch.json profile config to run the app.
  5. Tap the button, run the crypto tasks and take note of the output
  6. Stop the app and start it with flutter run --profile
  7. Repeat step 5

Expected behavior
Regardless of starting the app with the launch.config or the terminal command, the performance should be the same.

Screenshots

Debug console output running the app via launch.config

Screenshot 2022-02-19 at 17 42 42

Terminal output running the app flutter run --profile

Screenshot 2022-02-19 at 17 51 43

Crypto performance results of config run

IMG_1156

Crypto performance results of flutter run --profile

IMG_1157

Versions (please complete the following information):

  • VS Code version: Version: 1.64.2 (Universal)
    Commit: f80445acd5a3dadef24aa209168452a3d97cc326
  • Dart extension version: v3.34.0
  • Dart/Flutter SDK version: Dart SDK version: 2.16.0 (stable) (Mon Jan 31 15:28:59 2022 +0100) on "macos_x64"
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.0, on macOS 11.5.1 20G80 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.64.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsis bugis performance

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions