目录

Analyzing the Performance

QuickGameAssistant provides a tool for analyzing JavaScript performance with three modes: Chart, Heavy (Bottom Up), and Tree (Top Down). The tool helps you comprehensively analyze and resolve JavaScript performance issues of your game during debugging.

JS-CPU-Profiler

The DEVTOOL debugger of QuickGameAssistant provides the performance analysis tool JS-CPU-Profiler. In DEVTOOL, click the three-dot button in the upper right corner and choose More tools > JavaScript Profiler to open the performance analysis panel.

Performance Analysis Procedure

  1. Ensure that the phone is connected, and then click the run button.

  2. Once the game is running, click Start on the JavaScript Profiler panel to capture the profiler data.

  3. After the game runs for a period of time, click Stop to stop capturing. You can view the CPU usage on the JavaScript Profiler panel, as shown in the following figure.

  4. Click the drop-down menu in the upper left corner to select the mode in which you want to view data.
    • Chart: displays the flame chat in chronological order.
    • Heavy (Bottom Up): sorts functions by their individual impact on performance and allows you to inspect their call paths.
    • Tree (Top Down): provides an overview of the call structure, starting from the top of the call stack.

  5. You can perform the following steps to comprehensively analyze and optimize the JavaScript performance of your quick game based on the three modes:
    1. Use the Heavy (Bottom Up) mode to obtain the optimization target.
    2. Use the Tree (Top Down) mode to analyze the call chain relationship and determine whether the call hierarchy can be optimized.
    3. Use the Chart mode to check the time distribution across functions.