Skip to content

test-pr-temp - #5

Closed
Ivy233 wants to merge 2 commits into
masterfrom
feat/async-load-phase1
Closed

Ivy233 wants to merge 2 commits into
masterfrom
feat/async-load-phase1

Conversation

@Ivy233

@Ivy233 Ivy233 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

- Add StartupTimingRecorder singleton and StartupTimingScope RAII helper
- Instrument plugin discovery, so load, dconfig creation, translation,
  applet load/create-root/init phases with timing scopes
- Replace anonymous Benchmark class in appletloader with StartupTimingScope,
  preserving the original qCWarning timeout warning behavior
- Add total_startup scope and JSON dump in main.cpp
- Zero overhead when DDE_SHELL_BENCHMARK env var is not set
- JSON report includes timestamp, version, pid, and samples array
- Output path configurable via DDE_SHELL_BENCHMARK_OUTPUT env var
Phase 1 low-risk optimizations for async plugin loading:
1. Translation files lazy-loaded per-applet in load() instead of
   global recursive load in exec()
2. DConfig instances created lazily via ensureAppletConfig() on first
   isAppletEnabled() call, instead of bulk creation in ensureAppletConfigs()
3. .so libraries preloaded via posix_fadvise in background thread
   after metadata scan to warm OS page cache

PMS: DDE-482
Log: 优化dde-shell插件加载性能,减少主线程阻塞
Bug: https://agentapi-dev.uniontech.com/multica/issue/DDE-482

fix: address code review issues for async-load phase 1 fix: 修复异步加载阶段一代码审核问题

1. Remove const from ensureAppletConfig() and isAppletEnabled(), eliminate all const_cast
2. Remove unnecessary mutable from m_appletConfigs and m_disabledPlugins
3. Remove unused #include <QSet>
4. Replace dlopen/dlclose with posix_fadvise to avoid ELF parsing and .init/.fini side effects

Log: 修复代码审核中指出的const-correctness违规、不必要的mutable、死代码及dlopen副作用问题
Influence: shell/appletconfigmanager.h shell/appletconfigmanager.cpp frame/pluginloader.cpp

cleanup: remove dead code and add preload failure log

cleanup: 移除死代码并补充预加载失败日志

1. Remove no-op ensureAppletConfigs() call, declaration, and definition
2. Add qCDebug log for open() failure in preloadPluginLibraries()

Log: 移除空的 ensureAppletConfigs() 死代码,补充 preload open 失败日志
Influence: 无功能影响,仅代码清理
@Ivy233 Ivy233 closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant