Charts from a small file
TOML or JSON in, dark PNG charts out, 5 to 7 ms a chart.
What it does
You write the numbers in a small JSON or TOML file, and pcmp draws them as dark, crisp charts in a hand-drawn pixel font: two or more parties side by side on one axis, how many times faster or slower one is than another, or plain bars.
Every chart shares one dark look, 1080 px wide, so charts from different runs and projects sit side by side; the party colours are yours to pick.
There is no plotting library: the canvas, the 5x7 pixel font and the PNG writer are a few hundred lines of Rust, so a chart is drawn the same, pixel for pixel, on every machine.
-
Paired bars
Every party's value on one shared linear axis from zero, the value beside each bar, and per row how many times faster or slower the first party is than the one it is compared with. Rows fall under group headings, and a row can carry a mark such as
*or†that a note explains. -
Three or more parties
Up to 12 parties on the same axis.
versusnames the one the first party's tags compare with, andbetter = "lower"turns the axis for times and latencies. -
Balanced ratios
1× in the middle, slower to the left and faster to the right on a symmetric log scale, so 3× slower is as long as 3× faster. pcmp draws it next to the paired bars for any data with two or more parties.
-
Single bars, your colours
One party's values when there is nothing to compare;
--kind barswith several parties draws one chart per party. A party'scolouris any#RRGGBBor one of the chart's roles, and the legend and the bars follow it.
Measured
- direct, clap for the command line among them; 27 crates for the library without clap
- 5
- README, at a glance
How to use it
-
Save the numbers as
demo.toml.title = "PARSE SPEED" unit = "MEGABYTES PER SECOND" better = "higher" suffix = " MB/S" parties = [{ name = "PARSER V2" }, { name = "PARSER V1" }] rows = [ { label = "CONFIG FILES", values = [612, 240] }, { label = "LOG LINES", values = [455, 420] }, { label = "DATA DUMPS", values = [1210, 388] }, ] -
Draw them. A JSON file with the same keys works the same.
pcmp demo.toml --out charts -
--kind all, the default, draws single bars for one party, and the paired and ratio charts for two or more.pcmp <DATA> [--out DIR] [--kind all|paired|ratio|bars] -
From Rust, the same charts with no command line:
default-features = falseleaves out clap.pito-compare = { git = "https://github.com/gmrdad82/pito-compare", tag = "v1.1.2", default-features = false }