Skip to content

Commit 152f7d3

Browse files
committed
Shorten crate binary-size summary line
Collapsed line now reads "no code size change (datafusion-bench)" when unchanged, or "code size change +/-XX% (datafusion-bench)" with the per-crate details table on expand when it changed. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent ff7a5fc commit 152f7d3

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

scripts/crate-bloat.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,17 @@ def main() -> None:
9696
vortex_head = sum(h for _, _, h, _ in rows)
9797
vortex_base = sum(b for _, b, _, _ in rows)
9898
vortex_delta = vortex_head - vortex_base
99-
n_crates = sum(1 for _, _, h, _ in rows if h > 0)
100-
share = f"{vortex_head / total_text * 100:.0f}%" if total_text else "?"
10199

102100
# Largest movers first, then largest crates.
103101
rows.sort(key=lambda r: (abs(r[3]), r[2]), reverse=True)
104102

105-
if have_base and vortex_delta != 0:
106-
summary = (
107-
f"Binary size ({args.target_name}, release vs develop): Vortex crates = "
108-
f"{fmt_size(vortex_head)} of .text across {n_crates} crates "
109-
f"({fmt_delta(vortex_delta)}, {fmt_pct(vortex_base, vortex_head)}, {share} of binary)"
110-
)
103+
if have_base:
104+
if vortex_delta == 0:
105+
summary = f"no code size change ({args.target_name})"
106+
else:
107+
summary = f"code size change {fmt_pct(vortex_base, vortex_head)} ({args.target_name})"
111108
else:
112-
suffix = " vs develop: no change" if have_base else ""
113-
summary = (
114-
f"Binary size ({args.target_name}, release): Vortex crates = {fmt_size(vortex_head)} "
115-
f"of .text across {n_crates} crates ({share} of binary){suffix}"
116-
)
109+
summary = f"code size {fmt_size(vortex_head)} ({args.target_name})"
117110

118111
# Nothing changed against develop: keep the comment to a single line.
119112
if have_base and vortex_delta == 0:

0 commit comments

Comments
 (0)