Skip to content

perf(ci): skip bytecode compile and unused caches in test jobs #4727

Description

@dan-petty

Problem or Motivation

setup-toolchain runs uv sync ... --compile-bytecode (.github/actions/setup-toolchain/action.yml:55). 'Bytecode compiled 19212 files' took 7.6-14.7 s per job, with a mean of 11.4 s (10 logs, measured). The test jobs restore a tooling cache (.mypy_cache and .ruff_cache) that they do not use. In Service Image Tests, the cache never hits and is never saved.

Saving: About 9 s per Tests & Coverage job and 11 s per Service Image Tests job, which is about 1.8 runner-min per push (estimated).

Found by the CI and test audit of 2026-11-11. The account runs at most 20 hosted jobs at one time (measured), so each job that does no work makes the queue of each pull request longer.

Proposed Solution & Architectural Design

  • Add an input to setup-toolchain that turns off --compile-bytecode.
  • Pass this input, and empty tooling-cache paths, in test-shard, service-image-test, changed-tests and job-time.

Risk: The workers compile the same modules one time at the start (CPU only).

Target Subsystem

SDLC, Git & PR Governance (.github/actions/setup-toolchain/action.yml, .github/workflows/ci.yml).

Existing Tool Considered

uv compiles bytecode only on request (--compile-bytecode). No new tool. Cost: about 10,000 tokens and 1 hour.

Acceptance Criteria

  • The logs of these jobs have no 'Bytecode compiled' line.
  • The mean shard job time falls by 5 s or more.

Dependencies

Depends on #4642.

Alternatives check of 2026-11-14: not-applicable.
Class: perf, no search.
Tool: none found.

Activity

  1. added
    source/agent
    type/infra
    scope/ci
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/infra. The perf prefix of the title gives the type.
    • Scope: scope/ci. The (ci) scope of the title gives the scope.
    • Priority: P2-Medium. Saves about 1.8 runner-min per push and shortens the queue, but nothing is broken and the change is an optimization.
    • Value: Medium. Reduces per-job time by 9-11 s and frees runner slots on every push.
    • Effort: Low. Add one input to an action and pass it plus empty cache paths in four job steps; estimated at about 1 hour.
    • Related: perf(ci): build the Service image once for its test shards #4642, which asks for a different change. Both cut CI time in test shards; #4642 builds the Service image once, while this adds a bytecode-compile input to setup-toolchain and clears unused cache paths.
  3. added
    priority/p2-medium
    on Nov 11, 2026
  4. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: perf. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  5. added
    status/in-review
    and removed
    status/new
    on Nov 14, 2026
  6. removed
    status/in-review
    on Nov 14, 2026
  7. added a commit that references this issue on Nov 14, 2026
  8. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/cisource/agenttype/infravalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions