You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article presents an RFC proposal to add a HostPlatformTiming type to PipelineEntry for detailed performance analysis on different platforms
Motivation
The Paint phase in the Pixel Pipeline is completed on the Host Platform, with varying processing flows across different platforms, including some tasks with long execution times. To assist developers in more accurately analyzing the performance of this part, this RFC proposes adding a HostPlatformTiming type to PipelineEntry to describe the processes that reflect these platform-specific differences.
For example, on the Android system, the Paint phase is triggered by the system's DoFrame and includes three sub-phases: measure, layout, and draw. We will add monitoring for these three phases to the Android HostPlatformTiming.
Usage Guide
API
exportinterfacePipelineEntryextendsPerformanceEntry{identifier: string;pipelineStart: number;pipelineEnd: number;mtsRenderStart: number;mtsRenderEnd: number;resolveStart: number;resolveEnd: number;layoutStart: number;layoutEnd: number;paintingUiOperationExecuteStart: number;paintingUiOperationExecuteEnd: number;layoutUiOperationExecuteStart: number;layoutUiOperationExecuteEnd: number;paintEnd: number;frameworkRenderingTiming: FrameworkRenderingTimings[keyofFrameworkRenderingTimings]&FrameworkRenderingTiming;// Add a hostPlatformTiming attribute. The type of this attribute is defined differently on different platforms.hostPlatformTiming: AndroidPlatformTiming|IOSPlatformTiming|HarmonyPlatformTiming;}
The detailed type of hostPlatformTiming is defined as follows:
Use the Performance API to obtain PipelineEntry and determine the specific type based on the hostPlatformType.
import*asReactfrom"@lynx-js/react";import{root,useMemo,useState}from"@lynx-js/react";importtype{PerformanceEntry}from"@lynx-js/types";exportdefaultfunctionApp(){const[receivedEntries,setReceivedEntries]=useState<Set<string>>(newSet<string>());useMemo(()=>{"background-only";// 1. Create a performance observer.constobserver=lynx.performance.createObserver((entry: PerformanceEntry)=>{// 3. get "pipeline"if(entry.entryType=="pipeline"){constpipelineEntry=entryasPipelineEntry;consthostPlatformTiming=pipelineEntry.hostPlatformTiming;if(hostPlatformTiming&&hostPlatformTiming.hostPlatformType=="Android"){// 4. use timestamp of AndroidPlatformTimingconstmeasure=hostPlatformTiming.measureEnd-hostPlatformTiming.measureStart
....}}});// 2. register to listen to the "metric.fcp" and "pipeline" event.observer.observe(["pipeline"]);},[]);return(<viewclassName="container">
....</view>);}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Introduction
This article presents an RFC proposal to add a HostPlatformTiming type to PipelineEntry for detailed performance analysis on different platforms
Motivation
The Paint phase in the Pixel Pipeline is completed on the Host Platform, with varying processing flows across different platforms, including some tasks with long execution times. To assist developers in more accurately analyzing the performance of this part, this RFC proposes adding a HostPlatformTiming type to PipelineEntry to describe the processes that reflect these platform-specific differences.
For example, on the Android system, the Paint phase is triggered by the system's DoFrame and includes three sub-phases: measure, layout, and draw. We will add monitoring for these three phases to the Android HostPlatformTiming.
Usage Guide
API
The detailed type of
hostPlatformTimingis defined as follows:Get HostPlatformTiming
Use the Performance API to obtain PipelineEntry and determine the specific type based on the
hostPlatformType.Beta Was this translation helpful? Give feedback.
All reactions