Skip to content

perf: remaining performance ledger after the 2026-07 hotspot round #30

Description

@CMGS

Status ledger for performance work after the #28 round and the cocoon #123 upgrade verification (bare-metal testbed, 2026-07-12). Numbers of record: warm claim 0.2ms, sequential clone claim 32-37ms, burst16 wall 287ms, cold ~320ms, fork(4) 185ms, exec RTT p50 0.27ms, fs_pull ~602 MiB/s, fs_push steady ~343 MiB/s.

Open — worth doing, needs a product decision

1. Wire protocol v2: multiplexed RPCs + binary bulk frames. The one remaining order-of-magnitude lever in this repo. Today every RPC pays a triple connection setup (SDK TCP dial + HTTP upgrade → relay hijack → fresh vsock dial): the fixed cost is the bulk of the 0.27ms RTT. A pre-dialed spare connection was measured and rejected (p50 0.20/0.48/0.36/0.35/0.39ms across 5 rounds vs a stable 0.27-0.31ms baseline; p90/p99 consistently worse — the background dial contends with the foreground RPC), so the real fix is multiplexing over one long-lived conn. Bulk data rides base64-in-JSON (+33% wire, codec CPU); binary framing should lift fs_pull from ~602 toward 800+ MiB/s. Scope: SDK + relay + silkd (Rust) — cross-repo protocol change, staleness/idempotency semantics needed for reconnects. Do both together or not at all.

2. Refill admission re-eval (refillSem=4 / per-golden). Un-blocked by cocoon #123 (sibling clones no longer serialize on the source flock). Claim-miss provisions are unbounded (verified: ClaimProvision calls provision directly), but refills and forks share the node-wide refillSem=4 — with cocoon now parallelizing, that cap may bound pool-drain recovery. One day of A/B (4 vs 8 vs per-golden admission) once a cocoon release carrying #123 is deployed.

Deferred — reopen triggers documented

item trigger
claimStore full-map snapshot+rewrite per mutation >120 live claims per node
idleOnce/archiveOnce O(n) scans under the manager mutex same
checkpoint TTL sweep re-lists the full store per tick checkpoint count grows 10x
fastBulk decode buffer per chunk (~600MB/s GC garbage at max pull) GC pressure shows in sustained-transfer profiles; needs a payload-ownership contract on Recv
resyncEgress serial EnsureLock at restart many egress claims + restart-time SLA
probeReady vsockOf fallback polls vm list (subprocess) at 100ms the fallback branch shows up in practice (it is rare by design)

Rejected with data — do not re-litigate without new evidence

  • SDK pre-dialed spare connection (H-4): see above.
  • fs_push chunk 256K→1M: steady-state identical (~343 MiB/s) across 3 rounds.
  • nft Lock netlink-conn merge: conns are lazy in nftables v0.3.0; the two batch round trips cannot merge safely without kernel destroy-table support.
  • silkd conn scanner-buffer pooling: unsafe — Close may race a blocked Recv from another goroutine (pty/port semantics).
  • encodeTagged rework: already 243ns / 2 allocs per control frame.

Physical boundaries — not this repo's levers

Cold boot (~320ms, guest kernel/init), fork (~185ms, ~512MB memory snapshot I/O), CH burst restore bandwidth, and the cocoon-side 16-way residual serializer (index flock + journal + per-clone CLI process startup; per-clone p50 85ms vs 27ms serial — see cocoon#123's follow-up notes). The CLI-process model itself (one fork+exec of the cocoon binary per engine operation) is the deepest cross-repo lever here (daemon/library mode).

Related: #29 (correctness, found in the same round).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions