Skip to Content
prasasti

Benchmarks

Speed and accuracy against other PDF libraries, measured in CI on every push.

GitHub Actions, Linux x86_64, 4 CPUs (CI run 47596797779). Times are medians of repeated runs in a fresh process, on one thread unless noted.

EngineAccuracy2,000 pages60,000 pages (100 MB)72 scans (200 MB)Opens damaged and encrypted files
prasasti100%60 ms2.2 s3 ms3 of 3
prasasti, 4 threads100%31 ms1.1 s2 ms3 of 3
Poppler pdftotext100%475 ms16.9 s32 ms2 of 3
pdfminer.six98%16.7 s2 of 3
oxidize-pdf85%191 ms36.8 s209 ms2 of 3
PyMuPDF (MuPDF)85%849 ms31.9 s544 ms3 of 3
pypdfium2 (PDFium)85%815 ms26.8 s141 ms3 of 3
pypdf85%2.9 s2 of 3
pdf_oxide83%1.05 s45.2 s429 ms3 of 3
lopdf69%684 mstimed out142 ms3 of 3

An empty cell means that engine wasn't run on that file. The Python package runs within 5% of these numbers.

What's measured

  • Accuracy: how close each engine's words, in order, come to the known text, averaged over six test files: plain prose, Unicode, two columns, tables, words without spaces and shuffled lines.
  • 2,000 pages and 60,000 pages: the time to get all the text out of a generated file of that size.
  • 72 scans: a 200 MB file shaped like a scanned book, one large image per page with the words in an invisible text layer on top, the way OCR software saves scans.
  • Damaged and encrypted files: an RC4 file, an AES-256 file and a truncated file.

On the three big files (2,000 pages, 60,000 pages and the scans) every engine's output was checked against the known text, and prasasti recovered every word.

The test files and the scoring come from pdf-bench, which compares 54 PDF libraries across 11 languages.

Run it yourself

The comparison lives in bench/ in the repository and needs uv and a Rust toolchain.

uv run --project bench bench/fetch.py
uv run --project bench bench/generate.py
cargo build --release -p prasasti-cli
uv run --project bench bench/compare.py

Why it's fast

  • The file is memory-mapped, and objects are parsed only when something asks for them.
  • Content streams are read without allocating per token.
  • Fonts are parsed once per document, and their character and width tables are flat arrays.
  • Pieces of text that continue each other are merged while the page is read, so layout works on lines, not single letters.
  • Pages don't depend on each other, so threads=0 spreads them across every core.

On this page