Recent troubleshooting Android WebView HTTPS power consumption and slow load problem resolution

Source: Internet
Author: User
Tags ticket
Recent troubleshooting Android WebView HTTPS power consumption and slow load problems
Problem: H5 page Heating power consumption
Troubleshooting: Viewing the CPU consumption curve from the Android Studio Profiler, it is found that the WebView Carousel wave consumes the CPU and peaks up to 45% in the static condition. Because the animation in the H5 page loaded by WebView results in a redraw of the entire webview.
Workaround: Swapping with the X5 kernel failed to solve the high CPU peak problem. Found that the carousel is written in jquery, the use of pure JS to implement the Carousel diagram, problem solving, CPU peak drop of 8%.

Problem: HTTPS H5 loading slow
Resolution: 1, first to troubleshoot HTTPS acceleration, enable session ticket can reduce the TLS handshake connection, equivalent to the HTTP mode of loading speed. Execute boot if not enabled. The main is to install the Proxy Capture tool certificate, so that the packet can be caught HTTPS to see if session ticket is enabled. and Wireshark tools to view the HTTPS TLS handshake Interactive Connection step sequence time for the underlying network TCPIP connection. Tools are available to view data and to troubleshoot acceleration effects.
2, Android WebView load slow troubleshooting, mainly through the WebView Webviewclient callback method: onpagestarted start loading, onloadresource load resources, onpagefinished loading end. Print log for troubleshooting time consumption. Replace X5 Core, can achieve 30% faster. JS script delay loading, can speed up rendering speed, up 40% yoy. Setblocknetworkimage use, you can gradually display, first render the text and then render the picture, there is a visual acceleration effect.

Recent troubleshooting Android WebView HTTPS power consumption and slow load problem resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.