Dropped frames when loading native ads

444 views
Skip to first unread message

Christer Nordvik

unread,
Oct 24, 2017, 6:09:03 AM10/24/17
to Google Mobile Ads SDK Developers
Hi. 


We have moved from FAN to AdMob native ads and the performance is causing us a lot of problems. When the native ads are downloaded it seems to do things on the main thread causing a lot of frames to be dropped. Can you look into this? It's very easy to reproduce by downloading a lot of native ads while scrolling a list. See below for a video of the issue and how it can be reproduced. 

1. Download https://github.com/googlecodelabs/admob-native-advanced-feed/archive/master.zip
2. Change code to remove the splash screen that hides the stutter (see below) 
3. Change to load 30 ads to more easily show the stuttering. 
4. Open app. 
5. Scroll through the list while the ads are downloading in the background
6. Notice the dropped frames when scrolling while the ads are downloading. You can see it here: https://www.youtube.com/watch?v=lZcmo6GRP7s

Changes to the sample app: 

 @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this, getString(R.string.admob_app_id));
if (savedInstanceState == null) {
loadMenu();
addMenuItemsFromJson();
loadNativeAd();
}
}

Deepika Uragayala- MobileAds SDK team

unread,
Oct 24, 2017, 2:51:26 PM10/24/17
to Google Mobile Ads SDK Developers
Hi Christer,

Thank you for reaching out to us. I'm not noticing any more than usual drop in FPS when using our sample apps and loading video Native Advanced Ads via RecyclerView. This might just be a device specific issue. Can you please send us the profile that you are noticing and perhaps can you try to change the device and see if the drop in FPS still remains the same? 

Regards,
Deepika Uragayala
Mobile Ads SDK Team

Christer Nordvik

unread,
Oct 25, 2017, 4:10:37 AM10/25/17
to Google Mobile Ads SDK Developers
Hi. 

APK of the sample app. 

New YouTube video of sample app from release APK with CPU rendering bars on: 

Device tested in video: 
Pixel

Devices tested with similar results: 
Pixel, Samsung S6, Samsung S7

It performed a bit better with the release APK but still as you can see the performance isn't good and it's nowhere near the performance of Facebook Audience Network ads. 

Can you run the sample APK with profiling on and let me know if you see different results? I've tested this with playstore apps that are using AdMob native ads in a list and I see the same issue there. 

- Christer

Chris Feldman (Mobile Ads SDK Team)

unread,
Oct 25, 2017, 2:45:10 PM10/25/17
to Google Mobile Ads SDK Developers
Hi Christer,

Thank you for reaching out to support. I would say the stutter that you're seeing is to be expected when injecting Native Ads into a RecyclerView. That's the reason the CodeLabs includes the loading splashscreen - to hide this stutter while the RecylerView is being updated and the ads are loaded. I would suggest using a workflow similar to what is in the CodeLabs and not showing your RecyclerView until is has been loaded completely.

Regards,
Chris Feldman
Mobile Ads SDK Team

Christer Nordvik

unread,
Oct 26, 2017, 8:27:00 AM10/26/17
to Google Mobile Ads SDK Developers
Are you saying that I should hide badly implemented code in the AdMob SDK by adding a fullscreen progressbar while fetching ads when we already have the news feed ready for the user? 

That the codelabs added a loading splashscreen seems like a very bad implementation choice since the user then has to wait seconds while the ads are downloading. I'm pretty sure that's not recommended anywhere delaying the user experience while fetching the ads. 

Is it possible to get an SDK engineer to review this and ask the engineer if there are areas in the code that can be improved? We have used FAN for many years and it's silky smooth compared to the AdMob native ads. 

- Christer

Chris Feldman (Mobile Ads SDK Team)

unread,
Oct 26, 2017, 3:01:19 PM10/26/17
to Google Mobile Ads SDK Developers
Hi Christer,

We recommend preloading Native Ads before showing them in a list, similar to how you'd preload content that's not hardcoded in an app. Native Ads are currently loaded using a WebView, which can affect frame rate.

Regards,
Chris Feldman
Mobile Ads SDK Team

Christer Nordvik

unread,
Oct 27, 2017, 11:29:30 AM10/27/17
to Google Mobile Ads SDK Developers
There are two issues here: 

1. Stuttering when loading ads
This really seems like a code bug since I cannot see why downloading ads on a background thread should interfere with the GUI thread? 

2. Stuttering when inflating ads. 
So this is due to Webview. Any plans to move away from Webview? We are using Native Advanced so is the MediaView inheriting from a webview? 

- Christer

Chris Feldman (Mobile Ads SDK Team)

unread,
Oct 27, 2017, 2:59:59 PM10/27/17
to Google Mobile Ads SDK Developers
Hi Christer,

We are investigating moving away from WebView for Native Ads, but it's a more fundamental change. I cannot comment on the timeline, though I will follow-up on this thread if more information becomes available.

Thank you,
Chris Feldman
Mobile Ads SDK Team

Christer Nordvik

unread,
Oct 28, 2017, 4:24:37 PM10/28/17
to Google Mobile Ads SDK Developers
Hi again. 

But is WebView related to #1 as well? I can't see how the WebView is involved when loading the ads before inflating them? 

1. Stuttering when loading ads
This really seems like a code bug since I cannot see why downloading ads on a background thread should interfere with the GUI thread? 

Chris Feldman (Mobile Ads SDK Team)

unread,
Oct 30, 2017, 2:57:15 PM10/30/17
to Google Mobile Ads SDK Developers
Hi Christer,

I'm not able to comment further on the exact way that the SDK works internally. But our team is always working on ways to improve the user experience.

I will update this thread if more information becomes available.

Regards,
Chris Feldman
Mobile Ads SDK Team

Christer Nordvik

unread,
Jan 2, 2018, 7:56:45 AM1/2/18
to Google Mobile Ads SDK Developers
Hi. 

Any more info on this? As you can see in this video we added native ads to our startup screen as well and the scrolling is stuttering a LOT when the ads are loading and when the ads are inflated: 

Especially the stuttering when the ads are loading is something that worries me. Is there any progress in optimising the SDK? Since we are getting unsure about the SDK we have a toggle to switch to Facebook Audience Network and those ads load in the exact same positions and they have a lot better performance than AdMob. 

- Christer

Chris Feldman (Mobile Ads SDK Team)

unread,
Jan 2, 2018, 3:03:10 PM1/2/18
to Google Mobile Ads SDK Developers
Hi Christer,

Thank you for following up. We do not have any updates to report at this time.

Regards,
Chris Feldman
Mobile Ads SDK Team

Deniz Mersinlioğlu

unread,
Jul 11, 2019, 11:39:56 AM7/11/19
to Google Mobile Ads SDK Developers
Hi Chris,

Is there any update about the issue that Christer previously asked?

Regards,
Deniz

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 11, 2019, 4:18:43 PM7/11/19
to mersinli...@gmail.com, google-adm...@googlegroups.com
Hi Deniz,

We don't have any update on this. But, as this is an old thread, can you please provide us the issue details that you have on a separate new thread and please make sure that you are using the latest version of the SDK and let us know as we have made some improvements with the SDK since last year.


Regards,
Deepika Uragayala
Mobile Ads SDK Team
 

ref:_00D1U1174p._5001U8Ko2j:ref
Reply all
Reply to author
Forward
0 new messages