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 on Android #2

Closed
stoff99 opened this issue Jan 17, 2020 · 8 comments
Closed

Performance on Android #2

stoff99 opened this issue Jan 17, 2020 · 8 comments
Assignees
Labels
android performance question Further information is requested

Comments

@stoff99
Copy link

stoff99 commented Jan 17, 2020

Hello @candidodmv ,

firstly thx for your fork, nice work.

We use this in our Xamarin Forms project.
I have a question related to the Android performance.
I figured out that the performance on Android is much lower than on iOS.

Are there some tips or tricks to improve the performance on Android side?
Maybe with a customer renderer or something like that?

Thx Stefan

@candidodmv candidodmv added the question Further information is requested label Jan 17, 2020
@candidodmv
Copy link
Contributor

You're welcome! I keep happy know that this effort was useful for someone.
But what kind of performance are you referring? What is the scenario you are facing issues?

@stoff99
Copy link
Author

stoff99 commented Jan 18, 2020

Hi,
the problem we see is that the loading performance of the exact same page takes much longer on Android than on iOS.
I recored your a video related to that: https://www.dropbox.com/s/tgqw9plhuft7j6a/WebView_iOS_vs_Android.mov?dl=0

@stoff99
Copy link
Author

stoff99 commented Jan 18, 2020

I wrote a lot of enable android:hardwareAccelerated="true" for the Webview renderer but i dont get this to work with your library.
Like that:
`
[assembly: ExportRenderer(typeof(WebView), typeof(CustomWebViewRenderer))]
namespace XXX.Droid.Renderers
{
public class CustomWebViewRenderer : WebViewRenderer
{
public CustomWebViewRenderer(Context context) : base(context) { }

    protected override void OnElementChanged(ElementChangedEventArgs e)
    {
        base.OnElementChanged(e);

        if (Control != null)
        {
            if ((int)Build.VERSION.SdkInt >= 19)
            {
                Control.SetLayerType(Android.Views.LayerType.Hardware, null);
            }
            else
            {
                Control.SetLayerType(Android.Views.LayerType.Software, null);
            }
        }
    }
}

}
`

But when i replace the WebView with your HypridWebView i get errors because of the wrong type.

@candidodmv
Copy link
Contributor

candidodmv commented Jan 24, 2020

Hello @stoff99 , now I could understand what you are referring to. Well, let's began from begin ...

The performance problems are more complex than you can imagine, due may there are to many reasons that can turing the any operation slower .

Such as:

In case of WebView we can cite some additions

  • Network latency
  • Web page heavy

But, what I found as suggestion on the web, and here, is really what your code snippet suggest above, what we can do, is try to implement this code and see if there any improvements, what do you think?

I will put this changes in a preview release version, you checkout if get better and give me the feedback related about.

@stoff99
Copy link
Author

stoff99 commented Jan 24, 2020

Hello @candidodmv

yes i know ;)
We was testing a lot the last days. We found also issues on server side.
We minimize a lot of js files and stuff like that.
We had also issues with the caching system. So the server returned status code 200 instead of 304 so the webview loads the files again and did not restore out of the cache and stuff like that ... :)

So if you could do that, that would be great!
Please tell me when you release this version and we will test if there is a difference!

Thx a lot for your time and help.
Greetings from austria!

@candidodmv candidodmv added android performance question Further information is requested and removed question Further information is requested labels Feb 3, 2020
@candidodmv candidodmv self-assigned this Feb 3, 2020
candidodmv pushed a commit that referenced this issue Feb 11, 2020
@stoff99
Copy link
Author

stoff99 commented Feb 18, 2020

Hello @candidodmv ,

thx for this good news.
We will test them as fast as possible and let you know.

@stoff99
Copy link
Author

stoff99 commented Feb 18, 2020

Hello @candidodmv ,

i had time right now to check.
The render time feels faster now. But its always hard to measure.
We will test while developing.

Thx a lot for your support.

@candidodmv
Copy link
Contributor

You're welcome @stoff99 , any news about the peformance please register here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android performance question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants