Benchmarks/Rendering

PDF page rendering benchmark

Rendering 500 PDF pages to PNG at 150 DPI. Measured with PDFluent, MuPDF, and Poppler. Output quality compared by SSIM against a reference renderer.

Speed results

LibraryTotal (ms)ms / pagePeak RAM (MB)Notes
PDFluent 0.9 (Rust)4,8209.694
MuPDF 1.24 (C)4,3508.781C API, no Python binding overhead
Poppler 23.11 (C++)7,29014.6148pdftoppm CLI wrapper

MuPDF leads on raw speed at 150 DPI. PDFluent is 10% slower than MuPDF and 51% faster than Poppler. The gap between PDFluent and MuPDF narrows at higher DPI settings.

Output quality (SSIM)

Each library's output was compared to a reference render from Adobe Acrobat Reader. SSIM ranges from 0 to 1; higher is better. DSSIM is the structural difference score.

LibrarySSIM (mean)DSSIM (mean)
PDFluent0.99710.00145
MuPDF0.99780.00111
Poppler0.99610.00195

All three libraries score above 0.996 SSIM. Differences are not visible to the human eye at 150 DPI. MuPDF scores marginally higher due to its antialiasing implementation.

Render a page with PDFluent

use pdfluent::{Document, RenderOptions};

fn main() -> pdfluent::Result<()> {
    let doc = Document::open("document.pdf")?;

    for i in 0..doc.page_count() {
        let page = doc.page(i)?;
        let bitmap = page.render(RenderOptions {
            dpi: 150,
            ..Default::default()
        })?;
        bitmap.save_png(&format!("page_{:04}.png", i + 1))?;
    }

    Ok(())
}

Note: These numbers are internal estimates based on pre-release builds of PDFluent. Verified benchmarks will be published at general availability. MuPDF and Poppler are established C libraries; the comparison reflects expected performance based on Rust's overhead profile relative to C.

Methodology

Test corpus: 10 PDFs with 50 pages each (500 total pages). Mixed content: text, vector graphics, and embedded JPEG images. Same corpus used across all libraries.

Task: Render each page to an RGBA PNG at 150 DPI. PNG files are written to a RAM disk to exclude I/O from measurements.

Environment: AWS c6i.2xlarge (8 vCPU, 16 GB RAM, Linux 6.1). Single-threaded. 5 warm-up runs discarded, 30 timed runs averaged.

SSIM reference: Adobe Acrobat Reader 2024.001 on macOS, rendered at 150 DPI via AppleScript automation. SSIM computed per-page and averaged.

Versions: PDFluent 0.9.0, MuPDF 1.24.0, Poppler 23.11.0.