Skip to content

perf(ci): PGO build for the x64-linux release binary (bench-gated) #619

Description

@BryanFRD

Follow-up to #507 (item 3). PGO was deferred there because the full release matrix cross-compiles five targets (x64/arm64 linux-musl via cross, x64/arm64 darwin, x64 windows), and PGO needs to run an instrumented binary to collect profiles — impractical for arm64/musl on x86 CI runners. This issue narrows the scope to the one target where PGO is clean to do and validate: x64-linux only.

Scope

  • Apply PGO only to the x86_64-unknown-linux-* release binary. All other targets keep the current LTO-only build, unchanged.
  • Do not reshape the rest of the release pipeline.

Proposed CI flow (x64-linux job only)

  1. Build an instrumented binary (-Cprofile-generate), e.g. via cargo-pgo.
  2. Run it against the existing fixtures (cargo run -- check over tests/fixtures/, plus mono-large) to collect profiles.
  3. Build the final binary with -Cprofile-use=… + existing LTO.
  4. Ship that binary in the x64-linux release tarball.

Bench gating (hard requirement before merge)

  • Compare micro-bench deltas vs baseline on the PR (CI already does this).
  • Validate the wall-time delta in the competitive bench (vs changesets / release-please) on x64-linux.
  • Refuse merge if any *_full_check_flow benchmark regresses. PGO ships only if the measured win is real on this target.

Out of scope

  • arm64 / musl / darwin / windows PGO (no practical instrumented-run path on current runners).
  • Local-dev PGO builds.

Expected upside: 5–15% wall time on top of LTO for the deterministic hot paths (full_check_flow, tag_index_build) on x64-linux. If the bench delta doesn't materialize, close without shipping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to existing feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions