Skip to content

Significantly worse performance of new RoundedSuperellipse compared to default BorderRadius #167366

@FelixMittermeier

Description

@FelixMittermeier

Steps to reproduce

  1. Create a page with many widgets which are using the recently introduced RoundedSuperellipse
  2. Open this page, go back, open again and you will see noticeable lags

Expected results

Equal performance as when I use the default borderRadius property.

Actual results

Significant worse performance. The raster thread is taking twice as long compared to the default borderRadius. This can be seen also in the video (at the second half I have enabled the performance overlay).

The phone used was an iPhone 14 Pro Max, so not a slow device.

Code sample

Slow code:

DecoratedBox(decoration: ShapeDecoration(shape: RoundedSuperellipseBorder(borderRadius: BorderRadius.circular(16)))

Fast code:

DecoratedBox(decoration: BoxDecoration(borderRadius: BorderRadius.circular(16))

Screenshots or Video

Screenshots / Video demonstration

Slow raster thread with lags using RoundedSuperellipseBorder (performance overlay enabled in the second half of the video):

ScreenRecording_04-17-2025.20-28-16_1-3.mp4

Normal performance using default BorderRadius (performance overlay enabled in the second half of the video):

ScreenRecording_04-17-2025.20-33-15_1-2.mp4

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.32.0-1.0.pre.73, on macOS 15.4 24E248 darwin-arm64, locale de-DE) [2,1s]
    • Flutter version 3.32.0-1.0.pre.73 on channel master at /Users/felixmittermeier/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a7f820163c (6 days ago), 2025-04-11 18:24:16 -0700
    • Engine revision a7f820163c
    • Dart version 3.8.0 (build 3.8.0-265.0.dev)
    • DevTools version 2.45.0-dev.0

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [1.558ms]
    • Android SDK at /Users/felixmittermeier/Library/Android/sdk
    • Platform android-35, build-tools 35.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [779ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [9ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [9ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)

[✓] VS Code (version 1.99.2) [8ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.108.0

[✓] Connected device (3 available) [5,8s]
    • iPhone 14 Pro Max (mobile) • 00008120-00086C192E60C01E • ios            • iOS 18.4 22E240
    • macOS (desktop)            • macos                     • darwin-arm64   • macOS 15.4 24E248 darwin-arm64
    • Chrome (web)               • chrome                    • web-javascript • Google Chrome 135.0.7049.86

[✓] Network resources [588ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.found in release: 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions