-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Android platform view performance issues #96679
Comments
Seriously, it's not about Android. In iOS, the performance drops significantly as well when Native Ads or Banner Ads are frequently included in a scrollable list. This have been said on the original thread so many times already but @jjliu15 , you excluded all these reports. Again, it's not about Android. |
Here is a graphical way to see the issue. This test was done with a Galaxy A3 from 2017. I have tried to reproduce the problem with an iPhone SE from 2020 but the performance is OK as expected, @rocketman7 can you provide a graphical comparison using the performance graph with the issue you are experiencing in an iOS device? PD: The linked project is a reproducible sample of the issue, just remember to add your account ID and the ad unit id in |
Okay, I will try to make a graphical comparison. However, what I thought it was the problem was not like you reproduced. It's like Native/Banner Ads are shown every 5 container of list. Your code place only one ad at the bottom of the screen. But what i said was like as below: Ad no.1 attached code snippet. * CommunityAd() is a widget of NativeAd.
|
@rocketman7 Hi. This is from /// Shrink wrapping the content of the scroll view is significantly more
/// expensive than expanding to the maximum allowed size because the content
/// can expand and contract during scrolling, which means the size of the
/// scroll view needs to be recomputed whenever the scroll position changes. I don't know for sure if the |
Hello, |
Thanks for the code sample @mkassan, I verified this issue on the latest master channel. There is a severe lag when scrolling also the ads flicker sometimes. I have attached the timeline trace if it can help, The sample app was run in profile mode with
dart-timeline-trace against the native ads sample flutter doctor -v
|
flutter/engine#31468 landed. This PR implements the majority of the improvements. However, I'm debugging an issue #98722 caused by this change. |
Thanks for your dedication @blasten. |
Hey everyone, I've been working on improvement perf of Android native views. Please try the latest changes, and share any findings: Steps
flutter channel master
flutter upgrade
google_mobile_ads:
path: <path>/googleads-mobile-flutter/packages/google_mobile_ads
|
performance get worse than before
device-2022-03-05-161427.mp4flutter doctor [✓] Flutter (Channel master, 2.11.0-0.0.pre.784, on Microsoft Windows [Version 10.0.22000.527], locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Chrome - develop for the web [✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0) [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.64.2) [✓] Connected device (4 available) [✓] HTTP Host Availability • No issues found! |
That means there is currently no way to use a Flutter app with ads without the app becoming completely unusable? At least on Android they are already trying to get a fix for the problem, as I understand it there is not even an idea for iOS how the problem could possibly be solved in the future. Especially for many small companies that use Flutter, ads are the only way to finance an app. I find this quite disappointing, because not every app can stay financially viable with in-app purchases or subscriptions. |
@medst if you can share the APK with us, that'd be helpful. |
@blasten ./Done |
@blasten hello , I testing in this. when I test in master ,I can saw I could find |
@medst you might be running into a different issue. As far as this issue is concerned, it should improve the performance issue: googleads/googleads-mobile-flutter#519 (comment) |
This issue was fixed by #100091. Other than googleads/googleads-mobile-flutter#532, no more changes are required in the googleads plugin. |
Hi @blasten , do you have plans to improve the performance for iOS as well? Is there a separate issue for iOS because of the performance problems? |
As I know, the second step for us is to make it work without thread merging in Android? Only make this step done, we will get a better performance, is that right? @blasten |
@eggfly there's no more thread merging after the latest changes. Both hybrid composition and
@cyanglaz would know about it. |
HI @blasten , the performance is improved very well. nice work 🔥 |
Another thing, I noticed that Flutter supports API 19 or above: https://docs.flutter.dev/development/tools/sdk/release-notes/supported-platforms |
I Think Hybrid Composition still support API 19. |
Thank you for bringing up the concern about iOS performance with multiple PlatformViews. As of now, it is not actively worked on as iOS doesn't have a way to display PlatformView content with a texture in a different thread like how it was done on Android. |
Thanks for the reply @cyanglaz, I hope you and the team will be able to find a way to improve ios views too. |
@eggfly - Yes. After this change, if you use platform views you have two options:
|
@cyanglaz Is there an issue that can be tracked for iOS? The current status is that Google Ads are not suitable for Flutter on iOS. I think this should at least be noted in google_mobile_ads that this package cannot be recommended for iOS. |
Is this really necessary? Can flutter_tools make detections during the compile process? Although this change does not match our breaking change policy, I'd still consider it as one. Flutter nowaday supports from 16 by default, yet has limits everywhere. (Sorry for the accidently reopen) |
@blasten What if we replace |
lockCanvas() performs poorly as it makes CPU copies. It makes apps very slow. You can try it yourself with a local engine if you are interested. |
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 |
This issue comes from the GMA plugin: https://github.com/googleads/googleads-mobile-flutter.
There is noticeable lag when webviews displayed using hybrid composition are placed in a scrolling view. The performance is significantly worse on android api < 10 and lower end devices, but it has been seen on higher API levels as well.
The GMA plugin uses hybrid composition on Android. Virtual display is not a viable workaround.
Reproduction details can be found in the original issue: googleads/googleads-mobile-flutter#269
The text was updated successfully, but these errors were encountered: