pdf-inspector
pdf-inspector Performance and Cost: Benchmark Routing, Layout, and OCR
Reproduce corpus speed and quality while separating native parsing, OCR, memory, storage, and hosted fallbacks.

What you will learn
- Trace detection and layout stages
- Run native extraction and OCR safely
- Design provenance checks
Before you start
- Basic Git and command-line usage
- Comfort reading a project README
You can explain the project, run its documented first step, and decide what to verify before adopting it.
Key takeaways
- Published benchmarks are reproducibility targets.
- Native and OCR paths have different cost curves.
- Quality and accepted-document cost matter more than raw speed.
Use the paired corpus
The README reports a 0.875 overall score and 0.470-second median 200-PDF run on an Apple M4 Pro with pinned versions. Re-run the paired harness and exact evaluator before making claims.
Use the pinned source evidence, record versions and assumptions, and ask a qualified reviewer to validate the result before adopting it.
Measure stages
Record detection, load, extraction, layout, table formatting, serialization, OCR routing, and downstream review separately. Include p50/p95, peak memory, bytes, CPU, pages, warnings, and cache state.
Cost per accepted document
Native extraction may avoid OCR service charges; routed pages add model/runtime cost. Include retries, storage, hosted fallback, and human correction when calculating total cost.
Use the pinned source evidence, record versions and assumptions, and ask a qualified reviewer to validate the result before adopting it.
Decision guide
| Criterion | Option A | Option B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
Implementation steps
- 1
Freeze corpus, versions, hardware, and warm-up policy.
- 2
Measure each parser stage and OCR branch.
- 3
Record quality, latency, memory, and spend.
- 4
Publish receipts and regression thresholds.
Copy-ready example
corpus -> detect/load/extract p50/p95
-> layout/tables/serialize
-> routed OCR pages -> accepted Markdown + review costFrequently asked questions
Can I quote 0.470s as a universal speed?
No. It is a median for a specified corpus, hardware, versions, and protocol.
Is OCR always the dominant cost?
Often, but measure page count, model/runtime, and hosted fallback instead of assuming.
Sources
- pdf-inspector README (captured 2026-08-31)Source checked 2026-08-31
- pdf-inspector repositorySource checked 2026-08-31