Skip to content

Publish the resource benchmark harness - #1

Merged
documentnode-dev merged 2 commits into
mainfrom
669-benchmark-public-repo
Aug 30, 2026
Merged

Publish the resource benchmark harness#1
documentnode-dev merged 2 commits into
mainfrom
669-benchmark-public-repo

Conversation

@documentnode-dev

Copy link
Copy Markdown
Collaborator

TermTree's memory, CPU, and cold-start claims rest on a measurement harness. This publishes it, so anyone can run it against their own installed applications rather than take the numbers on trust. A benchmark nobody can run is an assertion, not evidence.

benchmark/ is the one deliberate exception to this repository's source-free posture, licensed Apache-2.0 under benchmark/LICENSE and scoped to that directory alone. LICENSE.md and README.md are updated to say so — the previous wording asserted the repository contained no source at all.

What it measures

On macOS, every off-the-shelf attribution method is biased, and in a direction that depends on the runtime under test. WebKit helper processes are launchd-parented, so a process-tree walk misses them entirely; LaunchServices, conversely, does not enumerate an Electron app's helper processes. Measuring either runtime with one mechanism alone undercounts it severalfold. The harness takes the union of both, and reports memory two ways rather than picking the flattering one.

Safety and portability

The harness seeds application state and launches real applications, so being safe for someone other than its authors to run is a precondition, not a nicety.

  • Every subject is seeded, launched, and measured against a disposable per-run home directory under the OS temp dir. The runner's real application profiles are never read or written, and an explicit --home pointing at the real home directory, or an ancestor of it, is refused rather than obeyed. A pristine profile is also what makes independent runs comparable at all.
  • Subjects launch via open -n -F --env HOME=<scratch>, which keeps a real LaunchServices registration so helper attribution still resolves.
  • A run refuses to start when a subject is already running, keyed on bundle identifier rather than app name: two differently named bundles can declare the same identifier, and the second launch is then handed off to the running instance and exits having measured nothing.
  • Stale assumptions fail loudly instead of degrading silently — unrecognised cold-start log marks, a missing app data directory, and an unconsumed seed each invalidate the sample by name.
  • The Collaborator, CodeNomad, and diri seeders have never been checked against a real install. Their heavier tiers report invalidReason: "seed-format-unverified" rather than being counted as valid.
  • Bundle paths, the seeded repo, and the agent CLI are all overridable, so installs outside /Applications work.
  • doctor names every unmet prerequisite and how to clear it, and changes nothing.

Scope and honesty

macOS only, and structurally so: lsappinfo, footprint, vm_stat, notifyutil, and pmset have no Linux or Windows equivalents.

The README is explicit that the method and within-run ratios travel between machines while absolute figures do not — a reader on different hardware will not reproduce a given number and should not expect to.

The CodeNomad Electron-vs-Tauri pair is a supported standalone invocation: one MIT codebase, two runtimes, TermTree not a participant. Someone can run that alone to check the attribution correction behaves as claimed before believing any TermTree figure.

Verification

CI (new to this repository) runs the format check, clippy, and tests on macOS. It deliberately never runs a sweep — that needs an exclusive, quiesced machine for hours, and numbers from a shared CI runner would be misleading.

175 unit tests pass. benchmark/doc/resource-benchmark-harness-testing.md documents the manual pass, and records what is deliberately not verifiable without a quiesced machine — including launch isolation against a real application, which needs the subject quit first.

No measurement results are published here yet.

TermTree's memory, CPU, and cold-start claims rest on this harness, so it is
published here for anyone to run: a benchmark nobody can run is an assertion,
not evidence. It is the one deliberate exception to this repository's
source-free posture, licensed Apache-2.0 under benchmark/LICENSE and scoped to
that directory alone.

The harness measures an attribution asymmetry that every off-the-shelf tool
gets wrong in one direction or the other: on macOS, WebKit helper processes are
launchd-parented and so invisible to a process-tree walk, while LaunchServices
does not enumerate an Electron app's helpers. Measuring either runtime with one
mechanism alone undercounts it severalfold. The harness takes the union.

Safety and portability, so it can be run by someone other than its authors:

- Every subject is seeded, launched, and measured against a disposable per-run
  home directory created under the OS temp dir. The runner's real application
  profiles are never read or written, and an explicit --home pointing at the
  real home (or an ancestor of it) is refused rather than obeyed. A pristine
  profile is also what makes independent runs comparable at all.
- Subjects are launched with `open -n -F --env HOME=<scratch>`, keeping a real
  LaunchServices registration so helper attribution still resolves.
- A run refuses to start when a subject is already running, keyed on bundle
  identifier rather than app name: two differently named bundles can share an
  identifier, and the second launch is then handed off to the running instance
  and exits having measured nothing.
- Stale assumptions about TermTree fail loudly instead of silently degrading:
  unrecognised cold-start log marks, a missing app data directory, and an
  unconsumed seed each invalidate the sample by name.
- Collaborator, CodeNomad, and diri seeders have never been checked against a
  real install. Their heavier tiers report invalidReason
  "seed-format-unverified" rather than being counted as valid.
- Bundle paths, the seeded repo, and the agent CLI are all overridable, so
  installs outside /Applications work.
- doctor names every unmet prerequisite and how to clear it, and changes
  nothing.

Documented as macOS-only, and explicit that the method and within-run ratios
travel across machines while absolute figures do not.
The nightly toolchain is installed second, so rustup makes it the default and
clippy and test both ran under it. The nightly install carries rustfmt and
nothing else, so clippy failed outright on the first run.

Name the toolchain in every step rather than depending on install order.
@documentnode-dev
documentnode-dev merged commit 19ed7d1 into main Aug 30, 2026
2 checks passed
@documentnode-dev
documentnode-dev deleted the 669-benchmark-public-repo branch August 30, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant