perf(thumbnails): scaled JPEG decode and continuous worker batching
Major speedups for large-folder thumbnail generation: - JPEGs decode through mozjpeg at the smallest DCT scale covering 320px instead of full resolution, with catch_unwind and a fallback to the image crate for anything mozjpeg rejects. EXIF orientation preserved in both paths. - RGB8 pipeline end to end (no RGBA round-trip) and CatmullRom resize in place of Lanczos3. - Video posters grab the seeked frame directly instead of running the ffmpeg thumbnail filter (which decoded ~100 frames), with decode threads capped at 2 per process. - Workers only sleep when the queue is empty rather than 250ms after every batch. Image batches commit before videos start, and videos run sequentially off the rayon pool (blocking ffmpeg waits were starving image decode) with per-item commits so progress keeps moving through slow stretches.
This commit is contained in:
@@ -53,6 +53,7 @@ csv = "1"
|
||||
kamadak-exif = "0.5"
|
||||
notify = "6"
|
||||
tauri-plugin-notification = "2"
|
||||
mozjpeg = "0.10.13"
|
||||
|
||||
# ── Dev-mode performance ────────────────────────────────────────────────────
|
||||
# opt-level=1 on the main crate keeps incremental compile short.
|
||||
@@ -81,6 +82,10 @@ opt-level = 3
|
||||
opt-level = 3
|
||||
[profile.dev.package.fast_image_resize]
|
||||
opt-level = 3
|
||||
[profile.dev.package.mozjpeg]
|
||||
opt-level = 3
|
||||
[profile.dev.package.mozjpeg-sys]
|
||||
opt-level = 3
|
||||
|
||||
# Parallel work scheduler
|
||||
[profile.dev.package.rayon]
|
||||
|
||||
Reference in New Issue
Block a user