1e41f4b71Sopenharmony_ci# Application Performance Improvement Overview 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciPerformance is a crucial factor of application development. Users expect applications to perform seamlessly and smoothly. As application performance largely relies on programming, frame rate, launch and response times, we can optimize these aspects to improve user experience. This document offers a few steps you can follow to improve your application performance, as well as a lineup of useful performance profiling tools. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci## ArkTS High-Performance Programming 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciTo drive code execution speed – a key facet of application performance, try the following: 8e41f4b71Sopenharmony_ci- **Follow the [ArkTS high-performance programming practices](high-performance-programming.md).** 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci Following these practices can bring in better compilation optimization by ArkCompiler, greater performant machine code, and faster program running. 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci- **Use the AOT mode to compile and optimize applications.** 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci ArkCompiler uses Profile-Guided-Optimization (PGO) to generate performant machine code ahead of time (AOT), speeding up applications. 15e41f4b71Sopenharmony_ci## Reducing Frame Freezing 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciWhen frame freezing occurs, the user experiences stutters and lags in the application. To reduce frame freezing and [frame loss](reduce-animation-frame-loss.md), you can take the following measures: 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci- **Avoid long-running tasks on the main thread.** 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci The main thread, also called UI thread, is one of the most important threads in an application. Long-running tasks on the main thread can block UI rendering and result in overloading of the main thread. To minimize main thread work, execute long-running tasks on background threads such as [TaskPool or Worker](../arkts-utils/taskpool-vs-worker.md). 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci- **Reduce the redundant overhead of the rendering process.** 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci To lower the rendering overhead, use resource diagrams instead of drawing, properly use **renderGroup**, and set the size and position to integers. 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci- **Avoid frequent UI updates.** 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci Reduce unnecessary UI update operations, such as excessive UI refresh and layout calculation. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci- **[Improving layout performance](reduce-view-nesting-levels.md).** 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci Layouts in the user interface (UI) are a key part of interactions between users and your application. Poorly designed layouts can lead to a slow UI, from component creation and layout to rendering. To improve layout performance, reduce nesting and prioritize high-performance layout nodes. 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci- **Reuse components with LazyForEach.** 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci Combine ArkUI's [component reuse](component-recycle.md) mechanism and **LazyForEach** syntax to efficiently reuse component objects that have been created and cached. In this way you can have lower overhead in frequent component creation and destruction, faster component loading, and less UI thread load. 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci- **[Precisely control the number of associated components for state variables](precisely-control-render-scope.md).** 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci When components are associated with state variables (such as @State decorated variables), they are re-rendered when the state data changes. The more components associated, the more components re-rendered, and the heavier the UI thread load. By precisely controlling the number of associated components, you can create a better responsive UI. 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci- **[Carefully use state variable associated objects](proper_state_management.md).** 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ci If any member variable in an object changes, the components associated with the object are updated. Therefore, it is better to minimize objects associated with state variables. 46e41f4b71Sopenharmony_ci## Improving Application Startup and Response Times 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ciUsers expect applications to be loading fast and highly responsive. To improve the [application startup](improve-application-cold-start-speed.md) and [response times](improve-application-response.md), you can take the following measures: 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci- **Delay loading.** 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci Delaying loading of unnecessary resources can speed up application startup. When using container components such as [\<List>](../reference/arkui-ts/ts-container-list.md), [\<Grid>](../reference/arkui-ts/ts-container-grid.md), and [\<Swiper>](../reference/arkui-ts/ts-container-swiper.md), make sure of the provided [LazyForEach](../quick-start/arkts-rendering-control-lazyforeach.md) capability to effectively reduce the application startup time and memory usage. 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci- **Use cache.** 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci Adoption of a proper [cache policy](list-perf-improvment.md#caching-list-items) can improve the performance and responsiveness of applications. 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci- **Adopt asynchronous concurrency.** 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci [Asynchronous concurrency](../arkts-utils/async-concurrency-overview.md) allows an application to process time-consuming operations in background threads, thereby improving application responsiveness. 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ci## Using Performance Profiling Tools 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ciWith performance profiling tools, you can identify performance issues in applications and make informed improvements. DevEco Studio provides the following powerful performance profiling tools: 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci- **ArkUI Inspector** 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ci Use to inspect and debug the page layout of an application. 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci- **Launch Profiler** 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ciUse to identify performance issues with each phase of the launch process. 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ci- **Frame Profiler** 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci Use to take a deep dive into the root causes of frame freezing in the application or service. 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci- **Time Profiler** 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ci Use to gain visibility into the call stacks in hotspot areas based on CPU and process time consumption analysis during running of the application or service. 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ci- **Allocation Profiler** 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci Use to monitor in real time memory usage of the application or service. 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci- **Snapshot Profiler** 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ci Use to analyze the memory usage of the application. 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci- **[CPU Profiler](application-performance-analysis.md)** 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci Use to monitor CPU usage of the application. 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci <!--no_check-->