Commit 6287e57
committed
Merge #804: Improve debug log performance
fb87a8b qml: render debug log entries with a virtualized list (johnny9)
de76d84 qml: read debug log updates without reloading the file (johnny9)
d813155 qml: read debug log only while its page is selected (johnny9)
Pull request description:
## Summary
- Load and watch the debug log only while its settings page is selected.
- Read the bounded log tail on a worker thread and process ordinary appends incrementally instead of resetting every row.
- Limit individual physical log lines in the viewer to 1 MiB; oversized lines are skipped until their terminating newline without modifying `debug.log`.
- Initially load the newest 1,000 entries and expose older entries in 1,000-row increments through **Load more**.
- Replace the fully instantiated output with a virtualized `ListView`.
- Preserve the visible row and pixel offset across live prepends, tail pruning, and load-more appends.
## Motivation
The previous debug-log view instantiated every displayed row and rebuilt the full output whenever the model reset. A new log write could therefore trigger another full file read, model reset, and delegate rebuild, including while the debug-log page was not selected.
This change treats the model and view as one performance path: the model reads only the new bytes and publishes changed rows during normal appends, while the view instantiates only visible delegates and keeps its scroll anchor stable.
Follow-up to the performance problem described in #784 and the original viewer in #532. Contributes to #576.
Related: #768. Its targeted relative-time role update behavior is already present on `qt6` and remains intact after this refactor; this PR does not close that issue.
## Testing
- Built every commit in the branch independently.
- Built the final application with the matching non-OpenGL depends toolchain.
- Ran Bitcoin commit-message and whitespace checks on every commit.
- Ran Ruff 0.15 and `qmllint` on the changed Python and QML files.
- Ran the complete C++ unit suite: 540 passed, including `DebugLogModelTests`: 19 passed.
- Ran the complete QML suite: 391 passed; the remaining `Send::test_send_uri_import_schedules_fee_estimate` failure (`BitcoinUri is not defined`) reproduces on the PR base.
- Ran `test/functional/qml_test_debug_log.py` against the real application.
- Verified watcher-driven updates remain capped, offscreen rows are virtualized, and **Load more** adds older rows without moving the viewport.
ACKs for top commit:
pseudoramdom:
ACK fb87a8b
Tree-SHA512: 20162c60c882b41935ab6b45cef5a30e881fbad8b33175674c2cad555bcb17ea2293a3c0667fb555084300596853b61ca140cd59e28a8f1630e624662fb9daa711 files changed
Lines changed: 2185 additions & 419 deletions
File tree
- qml
- components
- models
- pages
- node
- settings
- test
- functional
- qml
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
| |||
94 | 103 | | |
95 | 104 | | |
96 | 105 | | |
| 106 | + | |
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
| |||
102 | 112 | | |
103 | 113 | | |
104 | 114 | | |
105 | | - | |
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
109 | | - | |
| 118 | + | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
117 | 126 | | |
118 | 127 | | |
119 | | - | |
| 128 | + | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
123 | | - | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
| |||
132 | 140 | | |
133 | 141 | | |
134 | 142 | | |
135 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
136 | 156 | | |
137 | 157 | | |
138 | 158 | | |
139 | 159 | | |
140 | 160 | | |
141 | 161 | | |
142 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
143 | 167 | | |
144 | 168 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
149 | 179 | | |
150 | 180 | | |
151 | 181 | | |
152 | 182 | | |
153 | | - | |
154 | 183 | | |
155 | 184 | | |
156 | 185 | | |
157 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
158 | 192 | | |
159 | 193 | | |
160 | 194 | | |
| |||
171 | 205 | | |
172 | 206 | | |
173 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
174 | 211 | | |
175 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
176 | 222 | | |
177 | 223 | | |
178 | 224 | | |
| |||
183 | 229 | | |
184 | 230 | | |
185 | 231 | | |
| 232 | + | |
186 | 233 | | |
| 234 | + | |
187 | 235 | | |
188 | 236 | | |
189 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
284 | 289 | | |
285 | 290 | | |
286 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| |||
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| |||
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
| 230 | + | |
223 | 231 | | |
224 | 232 | | |
225 | 233 | | |
| |||
320 | 328 | | |
321 | 329 | | |
322 | 330 | | |
323 | | - | |
| 331 | + | |
| 332 | + | |
324 | 333 | | |
0 commit comments