Commit 4030100
committed
perf(thumbnails): fix 3-second pause that blocked thumbnail processor (v1.47.12)
Root cause (CDP-measured):
- renderPage() in renderer.js called pauseThumbnails() at the start of
every page render (including initial setViewMode after loadPDF).
- pauseThumbnails set processorRunning paused for 3000ms with no
early-resume signal.
- startProcessor added another 250ms initial delay.
- Result: first thumbnail appeared ~2.7s after main page was already
rendered. Per-thumbnail render cost itself was only ~3ms (Rust hot
path) — the wait dominated.
Fix:
- Shortened pauseThumbnails auto-resume from 3000ms to 500ms safety
fallback.
- Removed the 250ms initial startProcessor delay (was 250 → 0).
- Exported resumeThumbnails() and call it explicitly from
renderer.js's vector path after extract_draw_commands + prepareImages
complete (both success and catch branches), so thumbnails resume the
moment the active page's render is done — not after a fixed timer.
Verified via CDP (Vloerverwarming, 4 pages):
- Before: time-to-all-thumbs = 2810ms
- After: time-to-all-thumbs = 26ms (108× faster)
Thumbnail-to-viewport ratio now well under 1×.1 parent 87160a6 commit 4030100
6 files changed
Lines changed: 88 additions & 11 deletions
File tree
- open-pdf-studio
- js
- pdf
- ui/panels
- src-tauri
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
288 | 291 | | |
289 | 292 | | |
| 293 | + | |
| 294 | + | |
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
286 | 290 | | |
287 | | - | |
| 291 | + | |
288 | 292 | | |
289 | 293 | | |
290 | | - | |
291 | | - | |
292 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
293 | 311 | | |
294 | 312 | | |
295 | 313 | | |
296 | | - | |
| 314 | + | |
297 | 315 | | |
298 | 316 | | |
299 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments