Scripts for benchmarking zpdf against other PDF text extraction tools.
- Build zpdf first:
zig build -Doptimize=ReleaseFast - Install MuPDF:
brew install mupdf(macOS) orapt install mupdf-tools(Linux) - Python 3 with tqdm:
pip install tqdm
Test against 2,907 PDFs from the veraPDF test corpus.
cd benchmark
git clone https://github.com/veraPDF/veraPDF-corpus.git verapdfpython3 verapdf_bench.pyOn Apple M4 Pro:
| Tool | Time | PDFs/sec | Speedup |
|---|---|---|---|
| zpdf | ~6s | ~487 | ~5.7x |
| MuPDF | ~34s | ~85 | 1x |
Compare character-level accuracy against MuPDF reference output.
PYTHONPATH=../python python3 accuracy.pyRequires pypdfium2: pip install pypdfium2
Check repeated full-document extraction for accuracy-mode memory regressions.
PYTHONPATH=../python python3 memory_guard.py --pdf docs/pdf_reference.pdfIf you want this check in pytest as well, run:
ZPDF_RUN_MEMORY_GUARDS=1 PYTHONPATH=python python3 -m pytest -q python/tests/test_memory_regression.py