Skip to content

perf program: bring a charly command on the charly repo from ~80 s to ~10 s — the measured legs, their order, and a load-count / wall-time budget test so it cannot regress #1344

Backlog

Description

@aitrawog

Category

category:runtime

Type

type:feat

Remedy / files the remedy will touch

the tracking issue for charly#1340, charly#1341, charly#1024, spec#474, plugin-build#73, charly#1342, charly#1343; its own deliverable is the budget test: a fixture project run under CHARLY_STATS (charly#1343) asserting LoadUnified full-loads <= N, kind-connect passes <= 1 per word, and git subprocesses batched, in charly's go test

Cited design decision or org-rulebook rule (or none)

AGENTS.md C8 (prove behavior: a budget a regression can fail)

Classification

Non-blocking — genuinely separable; left unclaimed for a later session to pick up.

Evidence (verified: commands with output, file:line, measurements)

One uncontended charly config check-pod-overlay in the charly repo, broken down by mechanism. Every row is a measured A/B from a throwaway build; the issues hold the raw output:

leg measured cost fix spiked issue
kind-connect re-run per walk boundary 104 of 110 full loads; 82 s → 26 s wall, 139 s → 18 s CPU, 3.0 → 1.2 GB RSS per-process attempt memo #1340
declared-vs-connectable kind scope the cause of the never-connecting word — #1341
no per-process project-load memo 110 → 13 loads; 73 s → 28 s per-dir memo (unsafe for writers) #1024 (comment 7333136992)
serial git ls-remote per @main ref 37 calls, 16.8 s of 33 s parallel batch: 15.8 s → 1.3 s opencharly/spec#474
unchanged base re-tagged each build arch 7d13f2b32b9c tagged :0003, :0029, :0231 — opencharly/plugin-build#73
no timestamps in progress/phase logs 4m19s phase not attributable external awk prefix #1342
no profiling hooks / counters needed a patched main.go CHARLY_SPIKE_CPUPROFILE hook #1343

Multipliers: contention (the same command took 147 s and 317 s with beds alongside), every check-run phase is a fresh process (check-pod-overlay took 2646 s for 16 phases), and a cached charly box build comfyui-cdi spends 24 of 47 s before its first image.

The raw A/B lines behind the table (same command, same binary, uncontended):

arm=base rc=0 WALL 81.77 s USER 139.04 s MAXRSS 2981960 KB loads=110 passes=53 unit=a6709c74f7801180
arm=neg  rc=0 WALL 25.72 s USER 17.81 s MAXRSS 1233704 KB loads=6 passes=1 unit=a6709c74f7801180
process wall=33.0s ls-remote n=37 sum=16.8s wall-covered=16.8s [email protected] [email protected] max=0.64s
serial: 15.803168683 s
parallel(16): 1.304420560 s

Mechanism

Command cost is the sum of independent legs, each measured separately: repeated full project loads (charly#1340/#1341/#1024), a serial network leg (spec#474), and no instrument to see either (charly#1342/#1343). Each bed phase and each nested charly multiplies the sum, and contention multiplies it again. GC dominates CPU (53% in the profile) because every reload rebuilds the whole materialized tree.

Missed control

No performance budget exists anywhere: no test fails when a command's load count or wall time grows, so a 110-loads-per-command regression shipped unnoticed (charly#1024 measured the symptom in 2026-10 without a mechanism).

Blast radius

Every charly command and every check bed in the org. Beds dominate agent wall time (44 min for check-pod-overlay, of which the no-build phases are mostly load overhead), and the C11 gate is a bed.

Root fix

Land, in order: (1) charly#1340 attempt memo, the largest single leg; (2) spec#474 parallel ref batch; (3) charly#1343 counters; (4) this issue's budget test, pinning the new counts; (5) charly#1024 content-keyed load memo; (6) charly#1341 scope unification; (7) charly#1342 timestamps; (8) plugin-build#73 tag reuse.

Spike (its result, or none with the reason)

Combined, as a lower bound from the measured legs: the memo arm of charly#1340 leaves 26 s, of which spec#474's serial ls-remote is 16.8 s (under strace, 33 s). With the parallel batch measured at 1.3 s, one charly config drops from 82 s to roughly 10 s. That is an estimate from the measured parts, not one combined run. It becomes a measurement once #1340 and spec#474 land together.

Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)

Activity

  1. added
    category:runtime
    type:feat
    on Dec 2, 2026
  2. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    New measurement for this program, from a different command: charly box build openclaw on a no-change tree (opencharly/layer-openclaw, a private BuildKit daemon, charly 2026.335.1816, every image reused with an identical digest). Each output line was timestamped:

    28:  147.3 +  0.0  --- Building cachyos.arch.arch (base quay.io/archlinux/archlinux:base-20260719.0.558306; builders none) ---
    42:  167.6 +  4.0  --- openclaw -> ghcr.io/opencharly/openclaw:2026.336.1559 (reused; image sha256:7bb3518db1a8e19a7917d7710b42ef9f673f7ff4bedaecfcab8
    44:  179.0 +  3.8  Notice: candy github.com/opencharly/layer-supervisord resolved to multiple git tags with differing content within one scope (box=ar
    
    • 147.3 s of 179.0 s pass before the first build step. The resolver notice pair (layer-container-nesting / layer-supervisord "resolved to multiple git tags") is printed 18 times before building, roughly 4–14 s apart. That fits one full project load per notice pair: the same load repeated about 18× in one command.
    • The actual build phase, four stages all reused, is ~20 s (147.3 → 167.6). Another load follows (175.2, 179.0).
    • The cold build of the same tree took 561.7 s. The identical rebuild took 134.8 s, then 179.0 s; the difference is host contention, not build work.

    This confirms the program's premise for the build path too: on a no-change rebuild about 85 % of the wall time is repeated loading, not building, and the BuildKit cache is working (every stage reused). Not claimed by me; recorded as evidence.

    Agent: openclaw-cdi · Claude Code session 7011c83d-8b59-4309-bde8-b5d3bb83fd75
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)

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

    category:runtimetype:feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions