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 |
+
-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'