fix: reduce fullscreen page flip stutter by async icon loading#726
Conversation
Set asynchronous: true on the Loader in IconItemDelegate to defer DciIcon instantiation across multiple frames. This prevents the synchronous creation of all icon components (22-32 per page) from blocking the main thread during page transitions, reducing the maximum single-frame stall from ~100ms to ~34ms. Log: Fix fullscreen launcher page flip animation stutter Influence: 1. Fullscreen launcher page flip animation smoothness 2. Icon display when scrolling to a new page fix: 通过异步加载图标减少全屏翻页卡顿 在 IconItemDelegate 的 Loader 上设置 asynchronous: true,将 DciIcon 的实例化分散到多个帧完成。避免翻页时每页 22-32 个图标组件在同一帧内同步 创建导致主线程阻塞,最大单帧卡顿从约 100ms 降低到约 34ms。 Log: 修复全屏启动器翻页动画卡顿问题 Influence: 1. 全屏启动器翻页动画流畅度 2. 滚动到新页面时的图标显示 PMS: BUG-352045
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSets the icon Loader in IconItemDelegate to load its source component asynchronously so DciIcon instances are created over multiple frames instead of blocking a single frame during fullscreen launcher page flips. Sequence diagram for asynchronous icon loading during fullscreen page flipsequenceDiagram
title Asynchronous icon loading during fullscreen page flip
actor User
participant FullscreenLauncher
participant IconItemDelegate
participant iconLoader
participant QmlEngine
participant DciIcon
User->>FullscreenLauncher: Swipe to next page
FullscreenLauncher->>IconItemDelegate: Request icons for new page
IconItemDelegate->>iconLoader: Set sourceComponent
IconItemDelegate->>iconLoader: Set asynchronous true
iconLoader->>QmlEngine: Schedule DciIcon instantiation
loop Multiple frames
QmlEngine-->>iconLoader: Create next DciIcon instance
iconLoader-->>DciIcon: Instantiate and bind data
DciIcon-->>FullscreenLauncher: Icon rendered on page
end
FullscreenLauncher-->>User: Smooth page flip animation with progressively appearing icons
Class diagram for IconItemDelegate and asynchronous icon LoaderclassDiagram
class IconItemDelegate {
+icons
}
class Loader_iconLoader {
+asynchronous bool
+sourceComponent
+loadSourceComponent()
}
class DciIcon {
+imageSource
+label
}
IconItemDelegate *-- Loader_iconLoader : contains
Loader_iconLoader *-- DciIcon : loads asynchronously
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段代码在 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议与注意事项虽然这个改动总体上是积极的,但在实际应用中建议注意以下几点:
总结: |
BLumia
left a comment
There was a problem hiding this comment.
印象里之前启动器用的是 Image + asynchronous 然后还被提过单子或者反馈说打开的时候不会直接显示所有图标,不过印象里当时讨论的结论是就该这样。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, Ivy233 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
Set asynchronous: true on the Loader in IconItemDelegate to defer DciIcon instantiation across multiple frames. This prevents the synchronous creation of all icon components (22-32 per page) from blocking the main thread during page transitions, reducing the maximum single-frame stall from ~100ms to ~34ms.
Log: Fix fullscreen launcher page flip animation stutter
Influence:
fix: 通过异步加载图标减少全屏翻页卡顿
在 IconItemDelegate 的 Loader 上设置 asynchronous: true,将 DciIcon 的实例化分散到多个帧完成。避免翻页时每页 22-32 个图标组件在同一帧内同步
创建导致主线程阻塞,最大单帧卡顿从约 100ms 降低到约 34ms。
Log: 修复全屏启动器翻页动画卡顿问题
Influence:
PMS: BUG-352045
Summary by Sourcery
Reduce main-thread blocking during fullscreen launcher page flips by making icon loading asynchronous in the icon delegate.
Bug Fixes:
Enhancements: