目录

Loading and Frame Loss Analysis: ArkWeb

Function Description

During app development, incorporating WebView into the app can enhance development efficiency, but this may lead to issues such as slow ArkWeb loading and frame loss. The ArkWeb analysis template in DevEco Profiler allows you to pinpoint the phase where issues occur based on key trace points in the ArkWeb execution process. If the issue occurs during the rendering phase, you can further analyze the frame loss issue by drawing on H:RosenWeb data, thread running status, and frame rendering process tracing data.

The ArkWeb template supports the following lanes: ArkWeb, User Events, ArkTS Callstack, Callstack, CPU Core, and Process. This section describes the ArkWeb lane. For details about other lanes, see the corresponding template.

Before analysis, create an ArkWeb template and capture related data. During the capture, trigger web-related scenarios. For details, see In-depth Capture for Problem Locating. Alternatively, click Open File in the session area and import historical data.

ArkWeb Loading Analysis

Based on the key trace points, the web page loading process is divided into five phases: Click Event, Component Initialization, Primary Resource Download, Sub-resource Download, and Render And Output.

Drag to select a range in the ArkWeb lane to view key trace points marking the time-consuming phases. Use the trace information to identify the corresponding thread.

In the Details area, you can jump to the lane where the key trace is located to further analyze the loading issues.

ArkWeb Frame Loss Analysis

  1. The ArkWeb sub-lane aggregates the trace information of web-related threads. By analyzing the trace points of key functions in the web rendering process, you can gain insight into the execution process of each frame. The aggregated information is as follows:

    • H:RosenWeb: records the amount of data to be submitted to the Render Service for unified rendering.
    • Compositor: handles CPU instruction synthesis for layers and manages dynamic effects as the composition thread.
    • CompositorGpuTh: retrieves rendering results from the GPU and sends synthesized buffers to the graphics subsystem for rendering execution.
    • Chrome_InProcGpu: performs rasterization.
    • VsyncGenerator: generates VSync signals at regular intervals on the graphics side and notifies rendering or animation threads to prepare for next-frame rendering.
    • VSync-webview: receives VSync signals from the graphics side and triggers WebView page rendering or redrawing based on these signals.
    • VizCompositorTh: listens for drawing signals, requests Web-specific VSync signals from the graphics system, and triggers system Web-related drawing or execution.
    • Web app render threads: have names ending with :render and handle graphical rendering tasks, including HTML/CSS parsing and layered layout and drawing.

  2. To detect frame loss, you can use the H:RosenWeb and PresentFence lanes.

    H:RosenWeb indicates the volume of data pending submission to the Render Service. In normal cases, each data volume is submitted to the hardware for display, indicated by the H:Waiting for PresentFence trace point in the PresentFence lane. If a data volume does not have this trace point in the PresentFence lane, frame loss may occur.

  1. In the ArkWeb sub-lane, the Web app render thread provides the capability to analyze the specific duration of each phase in sub-resource loading. Switch to the Sub Resource tab to view details,

    including the uniform resource locator (URL), cache type, whether it is a local resource replacement, resource request time (ns), queue time (ns), stall time (ms), DNS resolution time (ms), connection time (ms), SSL connection time (ms), server response time (ms), download time (ms), transmission time (ms), request method, status code, resource size before encoding, resource size after encoding, and HTTP version.

  2. Click on a row to view the corresponding cache information for that URL, including the cache lifetime, last modified time, expiration time, cache directives, unique resource identifier, and whether the resource has expired.