Skip to content

perf: coalesce concurrent document normalization - #9

Merged
dajiaohuang merged 1 commit into
mainfrom
perf/deduplicate-document-normalization
Aug 27, 2026
Merged

perf: coalesce concurrent document normalization#9
dajiaohuang merged 1 commit into
mainfrom
perf/deduplicate-document-normalization

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Summary

  • coalesce concurrent normalized-document cache misses by immutable content/profile target
  • recheck the cache after waiting so one caller performs the PDF/OCR pipeline and followers reuse its result
  • retain parallel conversion for distinct cache keys and avoid retaining an unbounded lock registry

RapidOCR inference remains behind its existing shared per-model lock; this change removes duplicate same-document work without assuming the OCR or PDF runtime is safe to parallelize.

Verification

  • pytest (310 passed, 14 skipped)
  • ruff check .
  • uv build --wheel
  • imported normalize_document from the built wheel
  • git diff --check

@dajiaohuang
dajiaohuang merged commit a039f45 into main Aug 27, 2026
2 checks passed
@dajiaohuang
dajiaohuang deleted the perf/deduplicate-document-normalization branch August 27, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant