Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
38 changes: 14 additions & 24 deletions benchmarks/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0
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)'
Expand Down Expand Up @@ -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):
Expand All @@ -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:
Expand Down Expand Up @@ -207,14 +205,6 @@ def build_svg():
f'<svg xmlns="http://www.w3.org/2000/svg" width="{WIDTH}" height="{HEIGHT}" viewBox="0 0 {WIDTH} {HEIGHT}" fill="none">',
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(
Expand Down
Loading
Loading