pdf-inspector
pdf-inspector 性能与成本:基准解析、版面与 OCR 路由
复现语料质量和速度并拆分本地与 OCR 成本。

你将学会
- Trace detection and layout stages
- Run native extraction and OCR safely
- Design provenance checks
开始前需要
- 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.
先看结论
- 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
用相同 200 PDF 语料、版本、硬件和预热协议复现结果,分别测检测、提取、表格、序列化、OCR、内存和人工修正。
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.
如何选择
| 比较维度 | 方案 A | 方案 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 |
实施步骤
- 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.
可复制示例
corpus -> detect/load/extract p50/p95
-> layout/tables/serialize
-> routed OCR pages -> accepted Markdown + review cost常见问题
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.
资料来源
- pdf-inspector README (captured 2026-08-31)来源核查 2026-08-31
- pdf-inspector repository来源核查 2026-08-31