-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuttering while scrolling PlatformViews only on iPhone 12 onwards (works on iPhone 7) #129632
Comments
Hi @llooz, were the stack traces you collected above using the Impeller is the default on stable 3.10+ so if you did not add the --no-enable-impeller argument when you run flutter run, it most likely used impeller. If you used skia, can you also share the trace files for impeller? Also, can you check on the master channel to see if the performance is any better? Please share the flutter doctor -v output of the master channel that you attempt this on? Thank you |
Hi @danagbemava-nc, I've also tried on master on an iPhone 12 Pro and the result is the same. I'm attaching a trace. flutter-ads-perf-iphone-12pro-master-trace.json.zip If you need more I'm here! doctor on master
|
I do not have an iPhone 12 or above device. I only have an iPhone XS. I attempted to reproduce this on my device but aside some initial jank frames, I did not observe any stuttering when I was scrolling. There are, however, a few jank frames in the trace files shared below after the initial jank, but I did not observe stuttering on my device at the time. Labeling for further insight from the team. Code sample can be found in the initial post. dart_devtools_2023-06-29_07_59_09.118-master.json.zip flutter doctor -v
|
I can confirm that on the iPhone XS the issue doesn't happen. Most of our apps monetization is based on Ads (aka WebView in PlatformView) and, while we can maybe afford to have some slower performance on older devices (like Android < 10), we can't on high end devices like iPhone >= 12.
We're available to offer any help to investigate and hopefully solve the issue! |
We need to add additional tracing to |
I have the same problem but I still use Skia. It greatly affects the user experience. |
I have the same problem on my iPhone 14 pro. |
I think this is actually a ListView problem, if my problem is the same as yours. Even with the simplest possible ListView, there's raster jank of up to 21 ms on iOS (I was only able to test on iPhone 13 Pro Max), quite consistently. I didn't have this problem a month and a half ago, so I'm wondering what's changed in flutter or iOS that's causing this. Looking at RasterStats, the biggest chunk of time is spent in WaitForNextDrawable, though I don't know if that's interesting or helpful. import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
List<String> items = List<String>.generate(1000, (i) => 'Item $i');
void _incrementCounter() {
setState(() {
_counter++;
});
}
Widget buildListItems(String textFor) {
return Text(textFor);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
Flexible(
fit: FlexFit.tight,
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(items[index]),
);
},
),
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
} ![]() [✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 14.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] VS Code (version 1.81.0) [✓] Connected device (3 available) [✓] Network resources Just wanted to update with more info, tested on a MacOS and Pixel 4a physical device, neither show the same jank. This appears to be an iOS only (and according to the original issue, certain iPhones) issue. |
try turn off Impeller |
Turning off Impeller doesn't resolve the issue, unfortunately. |
@llooz My issues with ScrollView jank were resolved when I tested an upgrade to 3.13, you might try that if you're still having issues and a version bump is possible. I had quite a few versioning issues to solve, a rather annoying Xcode update process, and cocoa pods update, but no jank is better than jank. |
This comment was marked as duplicate.
This comment was marked as duplicate.
If the Text widget replaced with other widget like ColoredBox / other, still got jank? |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Any status updates on this one? I am thinking about disabling ads in my app on ios devices because this issue seriously affects the user experience with a loss of income as well of course. |
what do I have to do now? I can barely use my app after 30 seconds of usage. It even heats up the phone. |
I can confirm the phone heating issue. It's quite nice right now, because it's cold outside, but in summer this could become a problem. ;) |
This is still a significant issue on 3.22 IMO it has actually gotten worse since initial reports using flutter 3.10 back in 2023... |
This comment was marked as duplicate.
This comment was marked as duplicate.
Are there any updates regarding this? Our users using an iPhone with ProMotion suffer from terrible performance while scrolling when there are Ads on the screen. |
@danagbemava-nc could you provide some update about this issue? |
Details
We have performance issues with
PlatformView
s insideListView
only on iPhone 12 onwards.Tested on iPhone 7, iPhone 7 iPhone 11, iPhone 12, iPhone 12 Pro, iPhone 13, iPhone 13 Pro and iPhone 14 Pro.
We can exclude ProMotion to be the culprit because iPhone 12, iPhone 12 Pro and iPhone 13 don't have it.
While scrolling on an iPhone 12 Pro we see strange stuttering (vsync?) with some slow raster phase that causes the frame rate to be unstable around 53/55 fps and sometimes drops to 48 fps.
On iPhone 7 and iPhone 11 the issue is not present with a mostly stable framerate.
Sample project available at https://github.com/llooz/flutter_ads_list_perf.
We're able to offer any kind of support to help solve this issue.
Here are some video recordings and tracings:
flutter-ads-perf-iphone12pro.MP4
flutter-ads-perf-iphone7.MP4
flutter-ads-perf-iphone-12-pro-trace.json.zip
flutter-ads-perf-iphone-7-trace.json.zip
Target Platform: iOS
Target OS version: any
Devices: iPhone 12, iPhone 12 Pro, iPhone 13, iPhone 13 Pro, iPhone 14, iPhone 14 Pro
Logs
Logs
The text was updated successfully, but these errors were encountered: