Skip to content

Benchmark

etrafilatura against trafilatura 2.3.1 — pytest-benchmark medians over six documents of the fixture corpus (tests/resources/html/): four synthetic pages (minimal, article, comments, tables), PEP 8 and a Wikipedia article (121 KB and 236 KB of real HTML).

Generated by make benchmark on 2026-10-22 · Linux · cpython · commit 942fee3d.

Benchmark

Matrix

Median milliseconds per call, etrafilatura / trafilatura (speedup):

method minimal article comments tables real_pep8 real_wikipedia
extract_txt 0.34 / 0.44 ms (1.3×) 0.81 / 0.64 ms (0.8×) 0.63 / 0.69 ms (1.1×) 0.66 / 0.75 ms (1.1×) 29.48 / 44.21 ms (1.5×) 28.48 / 33.68 ms (1.2×)
extract_markdown 0.37 / 0.48 ms (1.3×) 0.88 / 0.72 ms (0.8×) 0.84 / 0.76 ms (0.9×) 0.74 / 0.83 ms (1.1×) 35.74 / 47.85 ms (1.3×) 29.81 / 35.53 ms (1.2×)
extract_xml_meta 0.43 / 0.75 ms (1.8×) 1.11 / 1.56 ms (1.4×) 0.81 / 0.91 ms (1.1×) 0.87 / 1.00 ms (1.2×) 38.36 / 80.18 ms (2.1×) 37.09 / 59.08 ms (1.6×)
bare_extraction 0.35 / 1.02 ms (2.9×) 1.01 / 0.65 ms (0.6×) 0.61 / 0.68 ms (1.1×) 0.66 / 0.74 ms (1.1×) 28.53 / 43.31 ms (1.5×) 28.64 / 34.12 ms (1.2×)
extract_metadata 0.08 / 0.46 ms (5.5×) 0.15 / 0.77 ms (5.2×) 0.10 / 0.14 ms (1.5×) 0.08 / 0.16 ms (1.9×) 7.56 / 33.27 ms (4.4×) 8.93 / 23.92 ms (2.7×)
html2txt 0.02 / 0.02 ms (1.2×) 0.11 / 0.11 ms (1.0×) 0.11 / 0.11 ms (1.0×) 0.09 / 0.09 ms (1.0×) 8.69 / 9.94 ms (1.1×) 8.65 / 8.74 ms (1.0×)
baseline 0.05 / 0.05 ms (0.9×) 0.15 / 0.15 ms (1.0×) 0.13 / 0.14 ms (1.0×) 0.12 / 0.13 ms (1.0×) 11.94 / 11.59 ms (1.0×) 9.06 / 8.82 ms (1.0×)

Reproduce

make benchmark    # uv run --group bench pytest -m bench --benchmark-json=bench.json, then the chart

Numbers move with the machine, the Python version and the engine releases; the committed chart is a snapshot, make benchmark regenerates it. Both libraries run in the same process, interleaved by pytest-benchmark, on the same fixtures.