Skip to content

perf: isolate scanned PDF OCR from worker heartbeat - #392

Merged
suguanYang merged 1 commit into
mainfrom
perf/wangbinqi/isolate-ocr-worker
Sep 8, 2026
Merged

perf: isolate scanned PDF OCR from worker heartbeat#392
suguanYang merged 1 commit into
mainfrom
perf/wangbinqi/isolate-ocr-worker

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • run scanned-PDF RapidOCR in a spawned child process
  • cap ONNX Runtime to 2 intra-op and 1 inter-op thread
  • preserve OCR page text/line output and add contract coverage

Verification

  • uv run pytest -q tests/contract/test_ocr_pages_contract.py tests/contract/test_doc_profile_anatomy_contract.py
  • uv run ruff check app/services/document_agent/tools/ocr_pages.py tests/contract/test_ocr_pages_contract.py

This isolates CPU-heavy local OCR from the heartbeat-bearing worker process. The downloaded reproduction PDF was not committed.

@suguanYang
suguanYang merged commit efc6384 into main Sep 8, 2026
6 checks passed
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