pdf-bench

PDF libraries tested on the same files

Speed, text accuracy and broken-file handling, measured one library at a time on an Apple M4

Extract all text from 2,000 pages pages per second

    What stood out

    • Rust leads on plain textoxidize-pdf read 14,700 pages a second, but it can't open the RC4-encrypted spec
    • Most extractors follow file orderOnly 10 of 34 read shuffled lines top to bottom; only Poppler and PyMuPDF4LLM get every test right
    • Missing spaces trip up 6 librarieslopdf, pdf_oxide, pdfplumber, @libpdf/core and both Go readers glue words together
    • MuPDF and PDFium never brokeEvery wrapper of either engine opened all three hard files; no pure Python reader recovered the truncated one
    • PDFKit merges slowly60 seconds for 2,157 pages, where pdfium-render takes 0.13 seconds
    • Bun speeds up pdf.jsThe same 2,000-page extraction ran 1.7 times faster than on Node

    Results

    Click a column to sort

    Engine

    Pages/s: text from 2,000 generated pages. Accuracy: words in the right order, averaged over 6 files with known text. Robust: encrypted (RC4, AES-256) and truncated files.

    Speed

    Median time per run, log scale, shorter is faster

    Accuracy

    Words in the right order, against known text

    Hard files

    Open it, count pages, get the text

    Node, Bun or Deno

    Same JavaScript code, three runtimes

    Method

    Every number here comes from one script you can rerun

    How each run works

    1. Each library gets a small adapter in its own language
    2. The adapter runs the task once to warm up, then repeats it for 2 seconds (3 to 20 runs)
    3. We report the median; memory is the peak of the whole process
    4. One job at a time, single-threaded, files already in the OS cache

    Know before you compare

    • Command-line tools start a new process every run, so they pay startup time
    • Timing starts after the runtime boots: JVM, WASM and interpreter startup aren't counted
    • Memory includes the runtime itself (a JVM or Node starts around 40 to 60 MB)
    • Every library uses its default text mode; a tuned setup may score higher

    Machine

    Files

    Run it on your machine