From 7889189e4185a0db01f92c81924b9f643913aaf2 Mon Sep 17 00:00:00 2001 From: lacvet Date: Mon, 6 Apr 2026 17:40:39 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9F=B0=EC=B2=98=EC=99=80=20=ED=8A=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=20=EC=A7=80=EC=97=B0=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9C=A0=ED=9C=B4=20CPU=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EC=A0=88=EA=B0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 앱 시작 시 LauncherWindow 전체를 미리 생성하지 않고 실제로 런처를 열 때만 만들도록 변경했습니다. 트레이 메뉴 PrepareForDisplay 사전 렌더도 제거해 사용하지 않는 팝업 레이아웃 계산이 부팅 직후 돌지 않게 정리했습니다. README와 DEVELOPMENT 문서를 2026-04-06 17:43(KST) 기준으로 갱신했고 Release 빌드에서 경고 0 오류 0을 확인했습니다. --- README.md | 3 +++ docs/DEVELOPMENT.md | 2 ++ src/AxCopilot/App.xaml.cs | 22 +++++++++++++--------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8842a1c..ac6d3ee 100644 --- a/README.md +++ b/README.md @@ -1305,3 +1305,6 @@ MIT License - 앱이 아무 창도 열지 않은 유휴 상태에서 PC를 무겁게 만들던 추가 초기화 경로를 줄였다. [App.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/App.xaml.cs) 에서 앱 시작 직후 숨겨진 [ChatWindow](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/ChatWindow.xaml.cs) 를 미리 생성하던 `PrewarmChatWindow()` 호출을 제거해, AX Agent를 실제로 열기 전에는 무거운 UI 트리를 만들지 않도록 바꿨다. - 같은 파일에서 [IndexService](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Services/IndexService.cs) 의 전체 인덱스 빌드와 `FileSystemWatcher` 시작도 앱 시작 시 즉시 수행하지 않고, 사용자가 실제로 런처를 열 때 `EnsureIndexWarmupStarted()`로 한 번만 지연 시작하도록 바꿨다. - 이 변경으로 런처/AX Agent를 열지 않은 상태에서 불필요한 전체 파일 스캔과 감시 훅, 숨겨진 대형 창 초기화가 줄어들어 PC 전체 체감 부하를 더 낮추도록 정리했다. +- 업데이트: 2026-04-06 17:43 (KST) + - 추가로 앱 시작 시 [LauncherWindow](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/LauncherWindow.xaml.cs) 를 미리 생성하지 않고, 실제로 런처를 처음 열 때만 `EnsureLauncherCreated()`로 만들도록 바꿨다. 이로써 보이지 않는 상태의 런처 UI, 바인딩, 보조 타이머 준비 비용을 평소에는 지연시켰다. + - [App.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/App.xaml.cs) 에서 트레이 메뉴의 `PrepareForDisplay()` 사전 렌더 호출도 제거해, 사용하지도 않는 트레이 팝업 레이아웃 계산을 앱 시작 직후 강제로 하지 않도록 정리했다. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 26d7252..b893fa5 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -4990,3 +4990,5 @@ ow + toggle ?쒓컖 ?몄뼱濡??ㅼ떆 ?뺣젹?덈떎. - Document update: 2026-04-06 17:24 (KST) - Removed the forced “at least one command must remain enabled” behavior from `SettingsWindow.xaml.cs`. The text-action command panel now allows every AI command, including `rewrite`, to be turned off, and the hint text in `SettingsWindow.xaml` now explains that the popup falls back to showing only `AX Commander 열기` when all AI commands are disabled. - Document update: 2026-04-06 17:35 (KST) - Reduced another startup performance hotspot in `App.xaml.cs` by removing the idle-time `PrewarmChatWindow()` path. AX Agent is no longer instantiated in the background at app startup and is created only when the user actually opens it. - Document update: 2026-04-06 17:35 (KST) - Changed launcher search warmup from eager startup work to on-demand initialization. `App.xaml.cs` now starts the first `IndexService.BuildAsync()` scan and `StartWatchers()` only when the launcher is actually shown through `ShowLauncherWindow()`, instead of running a full index scan and watcher hookup at boot even when the launcher is never opened. +- Document update: 2026-04-06 17:43 (KST) - Deferred `LauncherWindow` construction itself. `App.xaml.cs` now keeps only `LauncherViewModel` alive at startup and creates the actual `LauncherWindow` through `EnsureLauncherCreated()` the first time the launcher is shown, rather than instantiating the full hidden window at boot. +- Document update: 2026-04-06 17:43 (KST) - Removed the eager tray-menu warmup path (`PrepareForDisplay()`) from startup. This avoids doing popup layout/measure work for the tray menu until the user actually opens it, reducing idle desktop overhead further. diff --git a/src/AxCopilot/App.xaml.cs b/src/AxCopilot/App.xaml.cs index 05c616b..54b7017 100644 --- a/src/AxCopilot/App.xaml.cs +++ b/src/AxCopilot/App.xaml.cs @@ -14,6 +14,7 @@ public partial class App : System.Windows.Application private System.Threading.Mutex? _singleInstanceMutex; private InputListener? _inputListener; private LauncherWindow? _launcher; + private LauncherViewModel? _launcherViewModel; private NotifyIcon? _trayIcon; private Views.TrayMenuWindow? _trayMenu; private SettingsService? _settings; @@ -277,11 +278,7 @@ public partial class App : System.Windows.Application _pluginHost = pluginHost; // ─── 런처 윈도우 ────────────────────────────────────────────────────── - var vm = new LauncherViewModel(commandResolver, settings); - _launcher = new LauncherWindow(vm) - { - OpenSettingsAction = OpenSettings - }; + _launcherViewModel = new LauncherViewModel(commandResolver, settings); // ─── 클립보드 히스토리 초기화 (메시지 펌프 시작 직후 — 런처 표시 불필요) ── Dispatcher.BeginInvoke( @@ -625,10 +622,6 @@ public partial class App : System.Windows.Application : System.Windows.Visibility.Collapsed; }; - Dispatcher.BeginInvoke( - () => _trayMenu?.PrepareForDisplay(), - System.Windows.Threading.DispatcherPriority.ApplicationIdle); - // 우클릭 → WPF 메뉴 표시, 좌클릭 → 런처 토글 _trayIcon.MouseClick += (_, e) => { @@ -695,11 +688,22 @@ public partial class App : System.Windows.Application private void ShowLauncherWindow() { + EnsureLauncherCreated(); if (_launcher == null) return; EnsureIndexWarmupStarted(); _launcher.Show(); } + private void EnsureLauncherCreated() + { + if (_launcher != null || _launcherViewModel == null) return; + + _launcher = new LauncherWindow(_launcherViewModel) + { + OpenSettingsAction = OpenSettings + }; + } + private void OpenAiChat() { if (_settings == null) return;