HarmonyOS Flutter: Thread Analysis

HarmonyOS Flutter: Thread Analysis

Thread Execution Order

To analyze Flutter performance using trace tools:

Collect threads: Capture all threads during app runtime.

Sort by sequence

: Arrange threads in the order shown belo…


This content originally appeared on DEV Community and was authored by flfljh

HarmonyOS Flutter: Thread Analysis

Thread Execution Order

To analyze Flutter performance using trace tools:

  1. Collect threads: Capture all threads during app runtime.

Sort by sequence

: Arrange threads in the order shown below (numbers indicate priority).

  • 1️⃣ VSyncGennerator
  • 2️⃣ DVSync-app
  • 3️⃣ mmi_service
  • 4️⃣ Application Main Thread
  • 5️⃣ flutter.PointerEvent
  • 6️⃣ 1.ui
  • 7️⃣ 1.raster
  • 8️⃣ DVSync-rs
  • 9️⃣ RenderService
  • 🔟 RSUniRenderThread
  • ⚙️ RSHardwareThread
  • 🔄 dpu_gfx_primary

https://p.ipic.vip/2ueyv5.png
After collection, threads appear in reverse order (top → bottom):
https://p.ipic.vip/pumt1l.png
https://p.ipic.vip/5v10cw.png
https://p.ipic.vip/0rz887.png

Thread Descriptions

  1. VSyncGennerator
    • Generates software VSync signals to track frame timing.
  2. DVSync-app
    • Delivers software VSync signals to the Flutter app.
  3. mmi_service
    • Handles multi-modal input events (e.g., touch gestures).
  4. Application Main Thread
    • Main thread of the OS process (name/process ID match).
    • Runs plugin code and platform-dependent logic.
  5. flutter.PointerEvent
    • Transfers touch events from the Flutter engine to the UI thread (may not always exist).
  6. 1.ui (UI Thread)
    • Executes Dart code in the Dart VM.
    • Builds the Layer Tree (device-independent rendering commands).
    • Critical: Avoid blocking this thread!
  7. 1.raster (Raster Thread)
    • Converts the Layer Tree into GPU-renderable commands.
    • Runs Skia graphics library (CPU-bound, but impacts GPU performance).
  8. DVSync-rs
    • Provides VSync signals to the Render Service (RS) process.
  9. RenderService (RSUniRenderThread)
    • Primary thread for RS rendering pipeline.
  10. RSHardwareThread
    • Final stage of RS rendering before hardware submission.
  11. dpu_gfx_primary
    • Hardware-accelerated DPU (Display Processing Unit) signal.

Key Takeaways

  • Performance Optimization: Focus on minimizing work on the UI Thread (1.ui) and optimizing rasterization (1.raster).
  • Frame Drops: Investigate delays in DVSync-app, mmi_service, or GPU-related threads (e.g., dpu_gfx_primary).
  • Tooling: Use trace analysis tools to visualize thread activity and identify bottlenecks.

Let me know if you need further refinements!


This content originally appeared on DEV Community and was authored by flfljh


Print Share Comment Cite Upload Translate Updates
APA

flfljh | Sciencx (2025-06-27T01:22:47+00:00) HarmonyOS Flutter: Thread Analysis. Retrieved from https://www.scien.cx/2025/06/27/harmonyos-flutter-thread-analysis/

MLA
" » HarmonyOS Flutter: Thread Analysis." flfljh | Sciencx - Friday June 27, 2025, https://www.scien.cx/2025/06/27/harmonyos-flutter-thread-analysis/
HARVARD
flfljh | Sciencx Friday June 27, 2025 » HarmonyOS Flutter: Thread Analysis., viewed ,<https://www.scien.cx/2025/06/27/harmonyos-flutter-thread-analysis/>
VANCOUVER
flfljh | Sciencx - » HarmonyOS Flutter: Thread Analysis. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/06/27/harmonyos-flutter-thread-analysis/
CHICAGO
" » HarmonyOS Flutter: Thread Analysis." flfljh | Sciencx - Accessed . https://www.scien.cx/2025/06/27/harmonyos-flutter-thread-analysis/
IEEE
" » HarmonyOS Flutter: Thread Analysis." flfljh | Sciencx [Online]. Available: https://www.scien.cx/2025/06/27/harmonyos-flutter-thread-analysis/. [Accessed: ]
rf:citation
» HarmonyOS Flutter: Thread Analysis | flfljh | Sciencx | https://www.scien.cx/2025/06/27/harmonyos-flutter-thread-analysis/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.