From ceecf37ee2bd777cf5e82d4fb6449217e5e70c2d Mon Sep 17 00:00:00 2001 From: Alvin Wan Date: Tue, 7 Apr 2026 02:56:37 -0700 Subject: [PATCH 1/3] replace readme benchmark table with figure --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0f52829..759c1bf 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,9 @@ sources, modules = minify( Representative compression results, using `--rename-modules --rename-global-variables --rename-arguments`: -| Input | Original bytes | pymini | pyminifier | python-minifier | -| --- | ---: | ---: | ---: | ---: | -| TexSoup | 98,181 | 4.0x | 2.8x | 1.2x | -| timefhuman | 119,155 | 1.9x | 1.2x | 1.6x | -| rich | 1,217,001 | 2.6x | failed | 1.6x | +![Benchmark summary chart comparing minify-only minification and minify-plus-wheel compression across packages](./benchmarks/summary.svg) -For the above results, we validate that all package tests still run and pass, +For these results, we validate that all package tests still run and pass, with the minified source code. For the full compression tables, speed results, and package validation, see [benchmarks/README.md](./benchmarks/README.md). From 3c83221ccfb6f53eff800fc1f3772a6dc2470d95 Mon Sep 17 00:00:00 2001 From: Alvin Wan Date: Tue, 7 Apr 2026 03:04:44 -0700 Subject: [PATCH 2/3] tighten benchmark figure layout --- benchmarks/plot.py | 38 ++++------ benchmarks/summary.svg | 162 ++++++++++++++++++++--------------------- 2 files changed, 94 insertions(+), 106 deletions(-) diff --git a/benchmarks/plot.py b/benchmarks/plot.py index c418e86..2b11a65 100644 --- a/benchmarks/plot.py +++ b/benchmarks/plot.py @@ -40,17 +40,15 @@ ) WIDTH = 980 -HEIGHT = 430 -PADDING = 36 -TITLE_Y = 32 -SUBTITLE_Y = 54 -LEGEND_Y = 77 -PANEL_GAP = 28 -PANEL_TOP = 102 -PANEL_HEIGHT = 270 +HEIGHT = 344 +PADDING = 22 +LEGEND_Y = 22 +PANEL_GAP = 20 +PANEL_TOP = 40 +PANEL_HEIGHT = 282 PANEL_WIDTH = (WIDTH - PADDING * 2 - PANEL_GAP) / 2 -BAR_GAP = 6 -BAR_WIDTH = 24 +BAR_GAP = 8 +BAR_WIDTH = 26 BG = 'var(--bg)' PANEL = 'var(--panel)' PANEL_STROKE = 'var(--panel-stroke)' @@ -122,8 +120,8 @@ def panel_origin(index): def draw_panel_frame(elements, x, y, width, height, title, subtitle): elements.append(svg_rect(x, y, width, height, PANEL, rx=14, stroke=PANEL_STROKE)) - elements.append(svg_text(x + 18, y + 28, title, size=16, weight='600')) - elements.append(svg_text(x + 18, y + 48, subtitle, size=12, fill=MUTED)) + elements.append(svg_text(x + 16, y + 26, title, size=16, weight='600')) + elements.append(svg_text(x + 16, y + 44, subtitle, size=12, fill=MUTED)) def draw_legend(elements): @@ -150,10 +148,10 @@ def group_start_x(axis_left, group_width, group_index, cluster_width): def draw_multiplier_panel(elements, x, y, width, height, title, subtitle, packages, key, max_value, tick_values): draw_panel_frame(elements, x, y, width, height, title, subtitle) - axis_left = x + 54 - axis_right = x + width - 16 - axis_top = y + 82 - axis_bottom = y + height - 52 + axis_left = x + 46 + axis_right = x + width - 12 + axis_top = y + 72 + axis_bottom = y + height - 36 axis_height = axis_bottom - axis_top for tick in tick_values: @@ -207,14 +205,6 @@ def build_svg(): f'', style_block(), svg_rect(0, 0, WIDTH, HEIGHT, BG, rx=0), - svg_text(PADDING, TITLE_Y, 'pymini Benchmark Snapshot', size=24, weight='700'), - svg_text( - PADDING, - SUBTITLE_Y, - 'Validated package benchmarks from benchmarks/README.md, measured locally on April 7, 2026', - size=13, - fill=MUTED, - ), ] draw_legend(elements) draw_multiplier_panel( diff --git a/benchmarks/summary.svg b/benchmarks/summary.svg index c03b20f..efd5cdf 100644 --- a/benchmarks/summary.svg +++ b/benchmarks/summary.svg @@ -1,4 +1,4 @@ - + - -pymini Benchmark Snapshot -Validated package benchmarks from benchmarks/README.md, measured locally on April 7, 2026 - -pymini - -pyminifier - -python-minifier - -Minification -Minify-only compression multiplier by package; higher is better - -0x - -1x - -2x - -3x - -4x - - - -4.0x - -2.8x - -1.2x -TexSoup - -1.9x - -1.2x - -1.6x -timefhuman - -2.6x - -fail - -1.6x -rich - -Compression -Minify + wheel compression multiplier by package; higher is better - -0x - -2x - -4x - -6x - -8x - - - -7.3x - -6.6x - -3.6x -TexSoup - -3.4x - -3.1x - -3.2x -timefhuman - -6.6x - -fail - -4.6x -rich + + +pymini + +pyminifier + +python-minifier + +Minification +Minify-only compression multiplier by package; higher is better + +0x + +1x + +2x + +3x + +4x + + + +4.0x + +2.8x + +1.2x +TexSoup + +1.9x + +1.2x + +1.6x +timefhuman + +2.6x + +fail + +1.6x +rich + +Compression +Minify + wheel compression multiplier by package; higher is better + +0x + +2x + +4x + +6x + +8x + + + +7.3x + +6.6x + +3.6x +TexSoup + +3.4x + +3.1x + +3.2x +timefhuman + +6.6x + +fail + +4.6x +rich From 5a2d21dbaa1a1d09de88b75e44063e04f4bebcd8 Mon Sep 17 00:00:00 2001 From: Alvin Wan Date: Tue, 7 Apr 2026 03:08:33 -0700 Subject: [PATCH 3/3] remove benchmark figure side margins --- benchmarks/plot.py | 2 +- benchmarks/summary.svg | 140 ++++++++++++++++++++--------------------- 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/benchmarks/plot.py b/benchmarks/plot.py index 2b11a65..d1efd87 100644 --- a/benchmarks/plot.py +++ b/benchmarks/plot.py @@ -41,7 +41,7 @@ WIDTH = 980 HEIGHT = 344 -PADDING = 22 +PADDING = 0 LEGEND_Y = 22 PANEL_GAP = 20 PANEL_TOP = 40 diff --git a/benchmarks/summary.svg b/benchmarks/summary.svg index efd5cdf..fcba698 100644 --- a/benchmarks/summary.svg +++ b/benchmarks/summary.svg @@ -24,82 +24,82 @@ } - -pymini - -pyminifier - -python-minifier - -Minification -Minify-only compression multiplier by package; higher is better - -0x - -1x - -2x - -3x - -4x - - - -4.0x - -2.8x - -1.2x -TexSoup - -1.9x - -1.2x - -1.6x -timefhuman - -2.6x - -fail - -1.6x -rich - + +pymini + +pyminifier + +python-minifier + +Minification +Minify-only compression multiplier by package; higher is better + +0x + +1x + +2x + +3x + +4x + + + +4.0x + +2.8x + +1.2x +TexSoup + +1.9x + +1.2x + +1.6x +timefhuman + +2.6x + +fail + +1.6x +rich + Compression Minify + wheel compression multiplier by package; higher is better - + 0x - + 2x - + 4x - + 6x - + 8x - - -7.3x - -6.6x - -3.6x -TexSoup - -3.4x - -3.1x - -3.2x -timefhuman - -6.6x - -fail - -4.6x -rich + + +7.3x + +6.6x + +3.6x +TexSoup + +3.4x + +3.1x + +3.2x +timefhuman + +6.6x + +fail + +4.6x +rich