Commit 5b3dd83
committed
Fix CPU / thread locks + improve performance of BrowserBookmark plugin
## 1. High CPU and UI Freezing
* **Initial Load Spike:** The original plugin caused a massive CPU spike on first load due to inefficient database queries for favicons. **Fix:** We now create temporary indexes on the database copies, making the initial favicon scan virtually instantaneous.
* **Query-Time CPU Usage:** Typing in the search bar caused high CPU because the plugin checked for the existence of every icon file on every keystroke. **Fix:** We now pre-validate all icon paths once during the initial load, making search queries extremely fast, in-memory operations.
* **Background CPU Churn:** Actively browsing the web would trigger constant, high-CPU reloads of the plugin's data. **Fix:** We implemented a debouncing mechanism for the file watcher, ensuring that even a storm of file changes only results in a single, efficient data reload.
* **UI Freezing on Scroll (The Final Bug):** The most severe issue was the UI locking up with 100% CPU on multiple threads when scrolling through results. This was caused by the UI's renderer (SharpVectors) attempting to render corrupt SVG favicons created by a race condition. **Fix:** We now convert **all** favicons to PNG format during the loading process. This guarantees that the UI never receives a corrupt or incompatible image, permanently solving the freezing issue.
## 2. Improved Reliability and Functionality
* **Fixed Firefox Profile Discovery:** The plugin now reliably and automatically discovers the default Firefox profile, even in non-standard locations or with different naming schemes, by correctly parsing the `profiles.ini` file.
* **Fixed Real-Time Settings Changes:** Toggling the "Load favicons" checkbox now triggers an immediate data reload, so the change takes effect instantly without requiring an application restart.
## 3. Enhanced Code Quality and User Experience
* **Asynchronous Startup:** The entire data loading process is now fully asynchronous. The plugin displays an "initializing..." message while loading in the background, ensuring the Flow Launcher UI remains responsive at all times.
* **Code Stability:** eliminated unsafe `async void` methods, fixed various compilation errors, and centralized duplicated code into a shared helper class, making the plugin more stable and maintainable.1 parent d0c733b commit 5b3dd83
File tree
8 files changed
+373
-404
lines changed- Plugins/Flow.Launcher.Plugin.BrowserBookmark
- Helper
- Views
8 files changed
+373
-404
lines changedLines changed: 37 additions & 81 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
123 | 130 | | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
127 | 134 | | |
128 | | - | |
| 135 | + | |
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
204 | 160 | | |
205 | 161 | | |
0 commit comments