폴더 추가 시 UI 멈춤 수정 — 백그라운드 워커 저우선순위 + JPEG DCT 축소 디코드

원인: 실사진(수십 MP) 스캔 시 메타 추출(rayon)과 썸네일 워커가
NORMAL 우선순위로 전 코어를 포화시켜 WebView UI 스레드를 굶김.
풀해상도 JPEG 디코드는 파일당 ~72MB를 할당해 병렬 시 메모리 대역폭까지 포화.

- prio 모듈: 현재 스레드 우선순위 낮추기(Win BELOW_NORMAL / macOS nice+5),
  메타 전용 저우선순위 rayon 풀(코어-1, 전역 풀과 분리)
- 썸네일 워커 스레드·스캔 스레드를 저우선순위로 → CPU 포화 시 UI 우선 스케줄
- meta 이미지/영상 추출을 저우선순위 풀에서 실행
- JPEG는 jpeg-decoder DCT 축소 디코드(1/8 등) 사용:
  24MP 기준 풀디코드 63ms/72MB → 축소 38ms/1MB (1.7배·메모리 ~70배 절감),
  RGB24/L8만 처리하고 그 외(CMYK)는 기존 경로로 폴백

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
강 한
2026-07-19 14:19:18 +09:00
co-authored by Claude Fable 5
parent b4b1ef3241
commit 31a0487419
8 changed files with 183 additions and 20 deletions
+2
View File
@@ -240,6 +240,8 @@ pub fn spawn_scan_thread(
std::thread::Builder::new()
.name("scan".into())
.spawn(move || {
// 스캔/메타 오케스트레이션 스레드도 저우선순위로 — UI 응답성 우선
archive_indexer::prio::set_current_thread_low();
run_scan_pipeline(&db, &tools, &thumbs, source_id, Path::new(&root), &cancel, |p| {
if let Some(ch) = &on_progress {
let _ = ch.send(p);