This page covers the current benchmark tooling in docling-parse after the v7
config split.
Use:
perf/run_perf.pyfor per-page CSV benchmarkingperf/run_scaling.pyfor threaded scaling, pages/sec, and render sweeps
- Python 3.9+
- project installed in your environment
- perf extras only if you want non-docling baselines:
uv sync --group perf-testor:
pip install .[perf-tools]- accepts a PDF file or directory of PDFs
- runs one backend
- writes one CSV row per page
- prints overall stats, per-document stats, and docling timing breakdowns
doclingdocling-threadedpdfplumberpypdfium2(pypdfiumalias)pymupdf
python perf/run_perf.py <input> [options]
positional arguments:
input Path to a PDF file or directory of PDFs
options:
--parser, -p PARSER Backend to benchmark
--recursive, -r Recurse into subdirectories
--output, -o PATH Output CSV path
--limit, -l N Maximum number of documents to process
--bytesio Sequential docling only
--threads, -t N Threaded docling only
--max-concurrent-results N Threaded docling only
python perf/run_perf.py ./dataset -r -p docling
python perf/run_perf.py ./dataset -r -p docling-threaded --threads 8
python perf/run_perf.py ./dataset -r -p docling-threaded --threads 8 --max-concurrent-results 32
python perf/run_perf.py ./dataset -r -p pdfplumber
python perf/run_perf.py ./dataset -r -p pypdfium2
python perf/run_perf.py ./dataset -r -p pymupdfThe main CSV is written to:
perf/results/perf_<parser>_<timestamp>.csv
For docling runs, extra timing columns are appended per row. A second CSV with per-document aggregates is also written next to the main one.
- Sequential
docling:elapsed_secis page wall time. - Threaded
docling:elapsed_secis only the wait time for that emitted page result. - For threaded comparisons, use the printed total wall time and pages/sec.
- runs
DoclingThreadedPdfParseracross multiple thread counts - supports parse-only, render-only, or both
- prints speedup tables and pages/sec
- optionally writes one timing row per threaded page result
run_scaling.py accepts:
- a local PDF file
- a local directory of PDFs
- a Hugging Face dataset repo id whose
pdf/subdirectory contains PDFs
If no input is provided, it defaults to
docling-project/performance-dataset-bo767.
python perf/run_scaling.py [input] [options]
options:
--mode {parse,render,both}
--recursive, -r
--max-pages, -l N
--max-concurrent-results N
--threads 1,2,4,8,12,16
--scale FLOAT
--other "pypdfium2;pymupdf"
--enable-timing / --no-enable-timing
--timing-csv PATH
The scaling script still exposes decode-style and materialization-style booleans on the CLI, but internally compiles them into the new public config split.
Decode-stage booleans:
--keep-char-cells--create-word-cells--create-line-cells--keep-shapes--keep-bitmaps
Materialization booleans:
--materialize-char-cells--materialize-word-cells--materialize-line-cells--materialize-shapes--materialize-bitmaps--materialize-bitmap-bytes
They map to:
DecodeConfigfor compute tuningContentConfigwithContentLevel.SKIP,COMPUTE, andCOMPUTE_AND_MATERIALIZE
python perf/run_scaling.py ./dataset --mode parse
python perf/run_scaling.py ./dataset --mode render --threads 1,2,4,8,12,16
python perf/run_scaling.py ./dataset --mode both --other "pypdfium2;pymupdf"
python perf/run_scaling.py ./dataset --mode render --enable-timingwall_time (s): end-to-end elapsed time for the whole selected page setpages/sec: total scheduled pages divided by wall timems/page: wall time normalized by total scheduled pagesvs threaded(1): speedup relative to the threaded parser with one workervs <baseline>: speedup relative to the named baseline
Parse mode includes a sequential DoclingPdfParser baseline. Render mode does
not, because the sequential parser has no render path.
When run_scaling.py is called with --enable-timing, it writes a CSV with:
- mode
- threads
- success
- page number
timing_total_stiming_make_page_decoder_stiming_decode_page_stiming_create_word_cells_stiming_create_line_cells_stiming_render_page_s
Plot those timings with:
python perf/run_scaling_visualization.py timing.csv
python perf/run_scaling_visualization.py timing.csv --mode render --bins 80To inspect the slowest pages from a run_perf.py CSV:
python perf/run_analysis.py perf/results/perf_docling_20260622-120000.csv --top 25
python perf/run_analysis.py perf/results/perf_docling_20260622-120000.csv --nth 7This replays those pages through DoclingPdfParser.get_page_with_timings() and
extracts detailed decode-stage timings.