Trace

Trace is a performance analysis tool designed to help you identify and resolve performance issues in Lynx applications. With Trace, you can obtain a detailed rendering workflow of Lynx pages, making it easier to locate, analyze, and fix issues such as jank and long-running tasks.

Core Capabilities of Trace

1. Visualizing the Rendering Pipeline

Trace provides a complete timeline view of the entire page process, from script execution and Element construction to layout calculation and final rendering. With Trace, you can:

  • Clearly see the time distribution for each key stage (such as layout and painting);
  • Directly identify bottleneck nodes and performance issues within the process;
  • Detect redundant or repeated rendering tasks to optimize page structure.

This end-to-end visualization is especially valuable for page optimization and tuning complex page performance.

Trace Render Pipeline

2. Tracing Framework Execution

Trace dives deep into the Lynx Engine and thoroughly records:

  • The sequence of task scheduling and queue switching
  • The full picture of event handling chains
  • Precise timing and relationships for API calls

This information is invaluable for analyzing issues like asynchronous task congestion or event response delays.

Trace Task Scheduling

3. Rich Performance Analysis Tools

Trace is more than just a "timeline"—it's a multidimensional performance analysis platform:

  • Element Analysis: Track changes in the Element tree structure, identify high-frequency or high-cost node operations, and uncover performance risks in your page structure.
Element
  • NativeModules Call Analysis: Monitor detailed NativeModules call processes, clearly display the timing and parameters of each NativeModule call, and pinpoint potential bottlenecks.
NativeModules
  • Smoothness Analysis: Use flame charts of task durations to quickly locate the root causes of jank, helping you optimize animations and interactions.
Trace Frame

Next Steps

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.