Skip to content
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

Performance issue #16

Closed
urunky opened this issue Apr 27, 2020 · 11 comments
Closed

Performance issue #16

urunky opened this issue Apr 27, 2020 · 11 comments

Comments

@urunky
Copy link

urunky commented Apr 27, 2020

First, thank you for your great work!!!!!
I'm very happy to use your libraray. This library is what I'm looking for.

I'm using your library for my new developing android app.
I'm using 'FlatList' and using 'renderItem' for rendering NativeAdView.
NativeAdView is top of the list items. total 13 items are rendered.

But the performance is not good as I expected.

So I tested some cases.
all the results are actual device in debug mode. just after load native ad, no interaction.

device profile : samsung galaxy m20 ( Android 9)
react native : 0.61.5
library version : 0.2.6

  1. Not render NativeAd
    UI : 60 / JS: 60

  2. NativeAdView without any children

<NativeAdView
     adUnitID="ca-app-pub-3940256099942544/2247696110" // TEST adUnitID
 />

UI : 8~35 / JS: 30-35

  1. NativeAdView with children
<NativeAdView
    adUnitID="ca-app-pub-3940256099942544/2247696110" // TEST adUnitID
>
    <View style={themeStyle.bg}>
         <AdBadge />
          <View>
            <IconView />
            <View>
              <HeadlineView />
              <TaglineView numberOfLines={1} />
              <AdvertiserView />
            </View>
            <CallToActionView />
        </View>
    </View>
</NativeAdView>

UI : 5 ~ 17 / JS: 8 ~ 20

  1. only NativeAdView at App.jsx(root file)
    UI : 5 ~ 15 / JS : 9 ~ 12

When using release mode the performance is little bit better but not good. (I guess it's not over 30fps)

did you have any performance when testing on android devices?

@ammarahm-ed
Copy link
Owner

@urunky Thanks for opening this issue, I will look into why there is such performance drop and report back.

@ammarahm-ed
Copy link
Owner

Okay so I tested it, I am getting 60fps when there is only one ad in the Flatlist at a time, If i am rendering more than one, the fps drops and that is because you should not render more than one NativeAd at a time.

With one ad, i am getting 60fps in dev mode with ui components.

@urunky
Copy link
Author

urunky commented Apr 28, 2020

@ammarahm-ed Thanks for fast reply!!

Maybe my explanation was not exact.
My goal is using 2 native ads, start of list, end of list.
There are always enough items between two nativeads, user can't see more than one nativeAd at a time. I don't know this goal bans the admob nativead banner guides.

Like you said, If I use only one nativead, the performance is not bad(~40fps) in debug mode (because my testing device is very entry model).

But I'm using two nativeads, the fps drops to 5~20 fps.

I think I'd be better use only one nativead this time, and

Thanks again for your good lib!!!

@ammarahm-ed
Copy link
Owner

@urunky I will look into this to find the reason why the frames are dropping when there are multiple ads in the same screen. its a strange behavior. but until then you can make sure there is only ad rendered in the list at one time.

@paddy57
Copy link

paddy57 commented Apr 29, 2020

Hello @ammarahm-ed I'm using Samsung M30
My NativeAdView have

  CallToActionView,
 MediaView,
  IconView,
  HeadlineView,
  TaglineView,

I have a single ad on one screen,
with video ad units - I'm getting UI 9-15 fps and Js 9-15
with image ad units - UI 16-25 fps and Js 16-25 fps
is there any way to boost performance?

@ammarahm-ed
Copy link
Owner

@paddy57 @urunky I am investigating the issue, I hope this will be fixed soon.

@paddy57
Copy link

paddy57 commented Apr 29, 2020

@ammarahm-ed is there any direction I can look for ? I would like to help in solving this issue

@ammarahm-ed
Copy link
Owner

@paddy57 until now I have only been able to improve the performance incrementally at a very small level by removing some nesting of views on native side, but I am still unable to find the exact reason due to which the UI-thread is being blocked. You can look at the code on Native Android side to see if you can find any bottlenecks in code that might be the cause of the issue.

@ammarahm-ed
Copy link
Owner

@urunky @paddy57 this has been fixed, will come in 0.2.9 release. I am closing this issue now

@paddy57
Copy link

paddy57 commented Jul 8, 2020

@ammarahm-ed can you tell me how did you improve the frame rate?

@ammarahm-ed
Copy link
Owner

The issue was relatef to a Hack that i was using to make sure views were rendered properly but I realized it was doing more bad than good. You can update to the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants