Repository navigation
Significantly worse performance of new RoundedSuperellipse compared to default BorderRadius #167366
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.32Found to occur in 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Steps to reproduce
- Create a page with many widgets which are using the recently introduced
RoundedSuperellipse - 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!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.32Found to occur in 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Activity
maheshj01 commentedon Apr 18, 2025
Hey @FelixMittermeier, Thanks for filing the issue. Can you please confirm if the below code sample reproduces the issue on your end. If it doesn't then please share a minimal and complete code sample to reproduce the issue.
I verified the below code on a simulator as well as Google pixel 7 (Physical device) and it seems to work fine.
Screen.Recording.2025-04-18.at.17.53.51.mov
code sample
flutter doctor -v
master
FelixMittermeier commentedon Apr 21, 2025
@maheshj01 Thanks for answering. I slightly modified your code sample to make it easily reproducible now.
New screen recording:
ScreenRecording_04-21-2025.23-53-01_1.mp4
Sample code:
maheshj01 commentedon Apr 21, 2025
Thanks for the code sample reproduces on the latest master channel.
Screen.Recording.2025-04-21.at.18.53.20.mov
Screen.Recording.2025-04-21.at.18.49.32.mov
flutter doctor -v
master
dart_devtools_2025-04-21_18_50_39.869.json.zip
jonahwilliams commentedon Apr 29, 2025
The cause of the slowness is that the rounded super ellipose doesn't have a fast path for blurs. #163893 needs to be fixed. FYI @dkwingsmt
[Engine] Fast blurring algorithm for RSuperellipse (#169187)
[Engine] Fast blurring algorithm for RSuperellipse (flutter#169187)
github-actions commentedon Jun 8, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[Engine] Fast blurring algorithm for RSuperellipse (#169187)