⚡ Performance & 🛡️ Reliability: Async Process Management & Domain Sync Fix#34
⚡ Performance & 🛡️ Reliability: Async Process Management & Domain Sync Fix#34mx57 wants to merge 1 commit into
Conversation
- Refactor Start/Stop to async Task to prevent UI freezes - Use WaitForExitAsync for non-blocking process termination - Fix domain exclusion synchronization logic - Implement debounced settings saving to reduce disk I/O - Optimize BanditSelector selection using MaxBy (O(N))
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR introduces several critical improvements to performance, reliability, and UX:
Asynchronous Engine Management: Refactored the core engine control logic (Start/Stop/Switch) to be fully asynchronous. By using
await p.WaitForExitAsync()and moving process termination out of the UI thread, we eliminated the noticeable "freezes" (1.5s+ hangs) that occurred when stopping multiple engines (e.g., Zapret + Warp).Full Domain List Synchronization: Fixed a bug where only the target domains were synced to the engine directory. The system now properly synchronizes both the target list (
list-general-user.txt) and the exclusion list (list-exclude-user.txt), including legacy markers.I/O Optimization (Debouncing): Implemented a 500ms debounce for settings serialization. This prevents redundant disk writes when the user quickly toggles multiple checkboxes or types in domain lists.
AI Selection Performance: Optimized the$O(N \log N)$ sort with a $O(N)$ linear
BanditSelector.Pickmethod by replacing anMaxByscan for selecting the best strategy.Stability: Updated the update mechanism to await engine shutdown before attempting to overwrite binaries, preventing "file in use" errors during updates.
All changes were verified with the existing test suite (50/50 passed) and a full build targeting Windows. Insight recorded in
.jules/bolt.md.PR created automatically by Jules for task 5432020798255957903 started by @mx57