Table Benchmark

This benchmark tests the performance of table implementations.

Benchmark Setup

A simple table with three columns (text, image, text) and varying number of rows is laid out, using the available table implementation together with automatic page breaking.

Each benchmark script can be invoked standalone in the following way: script-executable NR_ROWS IMAGE_FILE OUTPUT_FILE.

The list of the benchmarked libraries:

HexaPDF

Homepage: http://hexapdf.gettalong.org
Language: Ruby
Version: Latest version

Prawn

Homepage: https://prawnpdf.org
Language: Ruby
Version: 2.5.0 + prawn-table 0.2.2

Prawn’s table implementation is available in the separate gem prawn-table.

ReportLab

Homepage: https://www.reportlab.com/opensource/
Language: Python
Version: 4.2.2 + accel extension

fpdf2

Homepage: https://pyfpdf.github.io/fpdf2/
Language: Python
Version: 2.7.9

Results

These benchmark results are from 2025-01-04.

benchmark graphic

    Time Memory File size
hexapdf 10 346ms 27.680KiB 22.079
prawn 10 253ms 25.020KiB 22.146
reportlab 10 217ms 48.236KiB 22.007
fpdf2 10 280ms 70.952KiB 21.638
hexapdf 100 399ms 30.388KiB 25.902
prawn 100 359ms 29.188KiB 33.825
reportlab 100 226ms 48.672KiB 28.077
fpdf2 100 308ms 71.092KiB 26.343
hexapdf 1000 580ms 43.436KiB 63.784
prawn 1000 1.330ms 64.084KiB 151.129
reportlab 1000 322ms 50.968KiB 88.365
fpdf2 1000 585ms 72.712KiB 73.454
hexapdf 10000 2.358ms 170.316KiB 444.796
prawn 10000 12.629ms 415.764KiB 1.339.194
reportlab 10000 4.594ms 72.704KiB 697.027
fpdf2 10000 3.348ms 85.228KiB 548.124