Skip to content

Eliminate macOS cold-refresh 30-second tail latency #504

Description

Summary

PET's macOS performance baseline has a deterministic cold-refresh tail near 30 seconds that is hidden by healthy P50 values.

Evidence

Across 11 successful main-branch performance baselines from July 24 through August 6, 2026:

  • macOS full-refresh P50 median: 137 ms
  • macOS full-refresh P95 median: 30,291 ms
  • Latest baseline (8bd5fb4, run 31071711968): P50 142 ms, P95 30,291 ms, mean 8,642 ms
  • The latest raw iterations were:
    • 30,370 ms (9 environments)
    • 30,195 ms (9 environments)
    • 24,927 ms (10 environments)
    • then 139, 131, 110, 144, 105, 128, and 174 ms (10 environments)

The same cache directory is reused while each iteration starts a fresh PET server. The first three processes are slow and initially miss one environment, after which the disk cache is warm. Environment inventory is otherwise stable (10 environments, 1 manager), so this is not explained by changing runner inventory.

Investigation requirements

  • Attribute each slow iteration to a refresh phase and locator using existing RefreshProgress/RefreshPerformance data or equivalent privacy-safe instrumentation.
  • Determine whether the wait is interpreter spawning, macOS locator probing, cache population, subprocess/pipe behavior, or another blocking path.
  • Verify every file-based detection path before retaining any spawn fallback.
  • Measure exact spawn/read operation counts in regression tests.

Acceptance criteria

  • Root cause is demonstrated with phase/locator and operation-count evidence.
  • A cold PET process discovers the complete expected environment inventory on its first refresh.
  • macOS cold-refresh tail no longer approaches the 15/30-second timeout boundaries.
  • A realistic macOS CI P95 threshold is established and enforced by the snapshot gate.
  • Median performance does not regress on macOS, Windows, or Linux.
  • Fix includes behavior tests and performance/operation-count tests.
  • No extra Python or manager process spawning is introduced.

Related

Activity

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

    bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions