Skip to content

Use a main PGO profile for binary-size measurements - #2768

Draft
zaniebot wants to merge 1 commit into
zb/track-binary-sizefrom
zb/binary-size-pgo
Draft

zaniebot wants to merge 1 commit into
zb/track-binary-sizefrom
zb/binary-size-pgo

Conversation

@zaniebot

@zaniebot zaniebot commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Train a PGO profile from a pinned revision of main using the release corpus and flags, then reuse it for both sides of the binary-size comparison. Pull request updates can reuse optimized dependency artifacts without retraining for each revision. Cache the profile and compiled workspace crates separately, and reject comparisons whose measurements use different profiles or training revisions.

The binaries are built natively, without SBOM embedding or manylinux packaging.

In these runs, the report took 15m46s cold and 7m37s warm. The eight-core profile and build jobs used 21.7 and 12.9 runner-minutes, respectively. In these warm runs, runner time was about 7% above non-PGO and 37% below PGO trained for each revision.

Stacked on #2730.

@zaniebot zaniebot added internal:ci Related to continuous integration workflows and infrastructure build:binary-size Measure Linux binary sizes for a pull request labels Oct 15, 2026
@zaniebot
zaniebot deployed to automations October 15, 2026 16:23 — with GitHub Actions Active
@astral-automations-bot astral-automations-bot Bot added the internal A refactor or improvement that is not user-facing label Oct 15, 2026
@zaniebot
zaniebot deployed to automations October 15, 2026 16:40 — with GitHub Actions Active
@astral-automations-bot

astral-automations-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Binary size

Binary Base (bytes) Current (bytes) Change (bytes) Change (%)
uv 37,882,064 37,882,064 +0 +0.00%
uvx 321,440 321,440 +0 +0.00%
uv-build 2,990,416 2,990,416 +0 +0.00%
Build details

Target: x86_64-unknown-linux-gnu.

Current revision: ffa5b07e.
Baseline revision: e558e08e.
PGO training revision: b8993e0a.

Native Cargo builds with release for uv and uvx, and minimal-size for uv-build. uv and uvx share a PGO profile trained on a pinned main revision using the release training corpus and flags. Incremental compilation is disabled. Sizes are uncompressed bytes; SBOM embedding and manylinux packaging are excluded.

CI run.

@zaniebot
zaniebot deployed to automations October 15, 2026 16:54 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 15, 2026 16:56 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 15, 2026 17:12 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 15, 2026 17:26 — with GitHub Actions Active
@zaniebot zaniebot changed the title Use release PGO to measure uv and uvx sizes Use a main PGO profile for binary-size measurements Oct 15, 2026
@zaniebot zaniebot changed the title Use a main PGO profile for binary-size measurements Use a main PGO profile for binary-size measurements Oct 15, 2026
@zaniebot
zaniebot deployed to automations October 15, 2026 18:06 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 15, 2026 18:11 — with GitHub Actions Active
Comment thread .github/workflows/binary-size.yml Outdated
env:
EVENT_NAME: ${{ github.event_name }}
RECIPE: ${{ hashFiles('.github/workflows/binary-size.yml', 'scripts/binary_size.py', 'scripts/prune_cargo_workspace_cache.py') }}
RECIPE: ${{ hashFiles('.github/workflows/binary-size.yml', 'scripts/binary_size.py', 'scripts/build_uv_pgo.py', 'scripts/prune_cargo_workspace_cache.py', 'test/ecosystem/**') }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Exclude unused head-revision training files from the cache recipe

These added hashes read the current checkout, but train() executes the trainer and ecosystem corpus from the pinned source checkout. Updating either head-revision input therefore invalidates the profile and baseline caches and reruns training without changing its inputs. PGO_REVISION already identifies the actual trainer and corpus; remove scripts/build_uv_pgo.py and test/ecosystem/** from this recipe hash.

@zaniebot
zaniebot deployed to automations October 15, 2026 18:22 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 15, 2026 18:32 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 15, 2026 20:58 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 15, 2026 21:14 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 22, 2026 05:01 — with GitHub Actions Active
@zaniebot
zaniebot force-pushed the zb/track-binary-size branch 2 times, most recently from 610bb32 to 65b1d89 Compare October 22, 2026 05:18
@zaniebot
zaniebot deployed to automations October 22, 2026 05:19 — with GitHub Actions Active
@astral-automations-bot

Copy link
Copy Markdown

Binary size

Binary Base (bytes) Current (bytes) Change (bytes) Change (%)
uv 46,279,376 46,279,376 +0 +0.00%
uvx 320,144 320,144 +0 +0.00%
uv-build 3,000,464 3,000,464 +0 +0.00%
Build details

Target: x86_64-unknown-linux-gnu.

Current revision: a5696b19.
Baseline revision: 31823db9.
PGO training revision: b8993e0a.

Native Cargo builds with release for uv and uvx, and minimal-size for uv-build. uv and uvx share a PGO profile trained on a pinned main revision using the release training corpus and flags. Incremental compilation is disabled. Sizes are uncompressed bytes; SBOM embedding and manylinux packaging are excluded.

CI run.

This branch was successfully deployed

1 active deployment
automations — a1850c54 Deployed Oct 22, 2026 by zaniebot via build-binary-size / publish / publish #11367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:binary-size Measure Linux binary sizes for a pull request internal:ci Related to continuous integration workflows and infrastructure internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant