pito-compare, measured

pcmp draws its own benchmark: bench/speed.py times each chart kind, a new process per chart, 50 runs each, then matplotlib drawing the same data the same way.

Against matplotlib

Start to PNG on disk, how many times faster, and the memory each one takes.

Paired bars, milliseconds per chart, lower is better: paired bars pcmp 7.1 against matplotlib 446.9, balanced ratios 5.5 against 421.9, single bars 5.7 against 408.1.
Start to PNG on disk pcmp 1.1.0 against Python 3.14 with matplotlib 3.11 drawing the same data as a similar dark 1080 px chart. Median of 50, load 4 on 32 threads, 2026-10-15.
Balanced ratio chart, pcmp against matplotlib, lower time is better: paired bars 63× faster, balanced ratios 77× faster, single bars 72× faster.
How many times faster 63×, 77× and 72× faster. The matplotlib chart is the plainer of the two (no tags, no pixel font), which favours it.
Paired bars, megabytes, lower is better: peak memory pcmp 12.9 MB against matplotlib 82.5 MB, 6.4× less.
Peak memory per chart 12.9 MB for pcmp, 82.5 MB for matplotlib, in the same run.

Not only the import

Most of matplotlib's time is Python and its import, but not all: in one run, drawing and saving after the import took 129 to 162 ms per chart, over twenty times pcmp's whole run.

At a glance

Time, memory, size, code and build, as pito-compare's README lists them.

Time per chart, start to PNG on disk 5.7 ms single bars, 5.5 ms balanced ratios, 7.1 ms paired bars
Against matplotlib 3.11, same data 63× to 77× faster (408 to 447 ms per chart)
Peak memory 12.9 MB (matplotlib: 82.5 MB)
Binary 1.2 MB (1,225,248 bytes, Linux x86_64, release profile, stripped)
Code 1,271 non-blank lines of Rust, canvas, pixel font and charts included
Dependencies 5 direct (png, serde, serde_json, toml, and clap for the command line); 40 crates in all, 27 for the library without clap
Release build from clean 21.6 s

How it was measured

Measured on 2026-10-15 on an AMD Ryzen 9 9950X (32 threads) under Linux, with Rust 1.97.1, on a lightly loaded machine (load 4 on 32 threads); times are the median of 50 runs, a new process per chart. bench/speed.py times pcmp, then Python 3.14 with matplotlib 3.11 drawing the same data; bench/pcmp-vs-matplotlib.toml holds the numbers it printed, and pcmp drew the charts above from it.

Every number is from pito-compare's README at v1.1.1.

Run it yourself

With matplotlib installed
cargo build --release
python3 bench/speed.py

Read it. Run it. It's MIT.

The code is MIT licensed, © Catalin Ilinca: read it, fork it, ship it in your own work. Its name and logos, and PITO MD's, are © Catalin Ilinca, all rights reserved, and are not covered by the MIT licence.