Tabulate Benchmark¶
Apple-to-apple performance comparison between zerodep tabulate and tabulate.
Test Environment
- CPU: x86_64 Linux
- Python: 3.12
- Tool: pytest-benchmark 5.2.3 (mean values reported)
- Reference: tabulate 0.10.0
- Last Updated: 2026-04-21
Implementations¶
| Implementation | File/Package | Description |
|---|---|---|
| zerodep | tabulate.py |
Single-file table formatter, stdlib only |
| tabulate | (reference) | Popular table formatting library |
Data Sizes Tested¶
| Label | Description |
|---|---|
| Small | Simple 3-column, 3-row table |
| Medium | 10-column, 20-row table with mixed types |
| Large | 15-column, 100-row table with numbers and strings |
Format Performance (Mean)¶
| Data Size | zerodep | tabulate | Speedup |
|---|---|---|---|
| Small | 54.4 us | 169.2 us | 3.1x faster |
| Medium | 403.2 us | 1,800.0 us | 4.5x faster |
| Large | 6,570.0 us | 27,340.0 us | 4.2x faster |
Key Takeaways¶
- 3.1-4.5x faster formatting -- single-file implementation avoids the overhead of the reference library's multi-module dispatch and feature negotiation.
- Speed advantage grows with data size -- zerodep's streamlined column-width calculation and row rendering scale more efficiently, reaching 4.5x on medium tables.
- Zero pip dependencies -- zerodep uses only
re,math,unicodedata, anddataclassesfrom the standard library.
Run It Yourself¶
pip install pytest pytest-benchmark tabulate
pytest tabulate/test_tabulate_benchmark.py --benchmark-only -v
Latest CI Results¶
Updated automatically on each release via Benchmark CI.