a4486547e8
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.
109 lines
3.3 KiB
TOML
109 lines
3.3 KiB
TOML
[package]
|
||
name = "phokus"
|
||
version = "0.1.0"
|
||
description = "A performant image gallery application"
|
||
authors = ["JezzWTF"]
|
||
edition = "2021"
|
||
|
||
[lib]
|
||
name = "phokus_lib"
|
||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||
|
||
[build-dependencies]
|
||
tauri-build = { version = "2", features = [] }
|
||
|
||
[features]
|
||
default = []
|
||
candle-cuda = ["candle-core/cuda", "candle-nn/cuda", "candle-transformers/cuda"]
|
||
|
||
[dependencies]
|
||
tauri = { version = "2", features = ["protocol-asset"] }
|
||
tauri-plugin-opener = "2"
|
||
tauri-plugin-dialog = "2"
|
||
tauri-plugin-fs = "2"
|
||
serde = { version = "1", features = ["derive"] }
|
||
serde_json = "1"
|
||
rusqlite = { version = "0.32", features = ["bundled"] }
|
||
r2d2 = "0.8"
|
||
r2d2_sqlite = "0.25"
|
||
sqlite-vec = "=0.1.9"
|
||
hnsw_rs = "0.3.4"
|
||
image = { version = "0.25", default-features = false, features = ["jpeg", "png", "webp", "gif", "bmp", "tiff"] }
|
||
fast_image_resize = { version = "6.0.0", features = ["image"] }
|
||
walkdir = "2"
|
||
rayon = "1"
|
||
tokio = { version = "1", features = ["full"] }
|
||
chrono = { version = "0.4", features = ["serde"] }
|
||
uuid = { version = "1", features = ["v4"] }
|
||
anyhow = "1"
|
||
log = "0.4"
|
||
ffmpeg-sidecar = "2.5.0"
|
||
xxhash-rust = { version = "0.8", features = ["xxh3"] }
|
||
memmap2 = "0.9"
|
||
sysinfo = "0.38.4"
|
||
candle-core = { version = "0.10.2", features = ["cuda"] }
|
||
candle-nn = { version = "0.10.2", features = ["cuda"] }
|
||
candle-transformers = { version = "0.10.2", features = ["cuda"] }
|
||
hf-hub = { version = "0.5.0", default-features = false, features = ["ureq", "native-tls"] }
|
||
tokenizers = "0.22.1"
|
||
ort = { version = "2.0.0-rc.12", default-features = false, features = ["std", "ndarray", "download-binaries", "copy-dylibs", "load-dynamic", "directml", "api-24", "tls-native"] }
|
||
ureq = { version = "3.3.0", default-features = false, features = ["native-tls"] }
|
||
zip = { version = "4.6.1", default-features = false, features = ["deflate"] }
|
||
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.
|
||
# Only the packages that are genuine hot-path bottlenecks in dev get opt-level=3
|
||
# (using "*" caused cargo to recheck all dependency fingerprints too aggressively,
|
||
# which caused spurious full rebuilds and linker conflicts).
|
||
[profile.dev]
|
||
opt-level = 1
|
||
|
||
# ML inference — without opt these run 20-50× slower than release
|
||
[profile.dev.package.candle-core]
|
||
opt-level = 3
|
||
[profile.dev.package.candle-nn]
|
||
opt-level = 3
|
||
[profile.dev.package.candle-transformers]
|
||
opt-level = 3
|
||
|
||
# ONNX runtime (WD tagger)
|
||
[profile.dev.package.ort]
|
||
opt-level = 3
|
||
[profile.dev.package.ort-sys]
|
||
opt-level = 3
|
||
|
||
# Image decode/resize workers
|
||
[profile.dev.package.image]
|
||
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]
|
||
opt-level = 3
|
||
[profile.dev.package.rayon-core]
|
||
opt-level = 3
|
||
|
||
# Tokenisation (embedding model pre-processing)
|
||
[profile.dev.package.tokenizers]
|
||
opt-level = 3
|
||
|
||
# Hashing (duplicate finder)
|
||
[profile.dev.package.xxhash-rust]
|
||
opt-level = 3
|
||
|
||
# SQLite (frequent db calls in workers)
|
||
[profile.dev.package.rusqlite]
|
||
opt-level = 3
|
||
[profile.dev.package.libsqlite3-sys]
|
||
opt-level = 3
|