Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
这一组提交围绕程序当前最明显的性能热点,连续收敛了冷启动、按需加载、设置窗口页面管理、URL/IPC 路由以及页面模板初始化几条主链路。
在这之前,程序在启动阶段会提前导入一批并非首屏必需的模块,例如统计、更新检查、主窗口部分重组件、安全验证链路、人脸抽取相关资源等;同时,设置窗口和主窗口内部还存在多套并行维护的页面映射、页面物化入口和验证判定逻辑,导致同一类行为在不同入口下重复实现、重复判断。除此之外,设置窗口搜索跳页依赖轮询等待页面创建,页面模板层也保留了多层
QTimer.singleShot(...)异步链路,这些问题虽然单点开销不一定都很大,但叠加后会明显拉长首次显示、首次切页和首次进入设置页时的响应时间。本次改动的核心目标有三点:
因此,这个 PR 不只是“做了几处小的性能补丁”,而是把几条影响启动体感和页面首次交互体验的公共基础链路重新整理了一遍。在不改变现有 JSON 存储方式、不调整页面协议和主要 UI 行为的前提下,尽量减少了程序启动时和首次访问时的额外工作量,同时也为后续继续做性能优化打下了更干净的结构基础。
主要变更
启动与冷启动优化
安全与人脸抽取按需加载
_require_and_run包装。主窗口与设置窗口结构收敛
设置窗口交互性能优化
QTimer调度。PageTemplate/PivotPageTemplate初始化阶段不必要的异步链路,减少页面首次创建时的额外等待。URL/IPC 与安全策略统一
verify_ops的统一策略,避免 handler 侧再维护第二套规则。其他修复与构建改进
预期收益
验证情况
pre-commit与compileall。