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