Repository navigation
perf: reduce Activity memory and repeated team and store work - #1925
Merged
Merged
Conversation
santoshkumarradha
marked this pull request as ready for review
October 24, 2026 18:02
santoshkumarradha
added a commit
that referenced
this pull request
Oct 24, 2026
* Reduce repeated work in Activity layouts, team disbanding and store reopening * Benchmark disbanding with managers present in real rosters * Document efficiency measurements and Activity allocation budget * Document efficiency fixes and coding workflow for PR 1925
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Three existing paths did repeated work as histories and teams grew:
Homesreading before mutation.No new dependency, persistent cache, schema, setting, command or user-facing behavior is introduced. Contributor guidance records the requested Matt Pocock diagnosis, TDD, module-design and two-axis review practices; delegates receive the same expectations.
How it was checked
Paired runs compare dev
127eb40fawith this change, using the same fixture and built application. Go 1.26.5, linux/arm64. Actual terminal timings include input delivery and observed screen output; fixture setup is separate. Latency scenarios reject model requests.Hover uses 12 alternating visible row targets. Startup uses three launches with 5 ms observation polling; its clock includes launch preparation, while the 23-second mock-database construction is excluded. The isolated startup profile keeps memory extraction off and exercises the normal conversation-search store open; it does not measure every optional startup setting. Disband figures are single diagnostic observations at each size and include persistence and redraw work. Activity fixture setup took 32–36 ms; team fixture setup was approximately 0.6 seconds at 10,000 memberships and 2–3 seconds at 40,000. These are reproducible observations, not universal latency gates.
Activity's 4 MiB real-body allocation regression fails on the unchanged baseline at 12,479,576 bytes and passes with this change. Independent overlay copies add 40 small allocations per paint; total allocated bytes fall 83.5%. Stripped binaries built with the same target/flags remain exactly 67,764,489 bytes; module dependencies are unchanged.
Public Disband benchmarks with managers present in their rosters measured 168 → 3.35 ms at 10,000 memberships and 2,200 → 11.88 ms at 40,000 (three iterations; fixture cloning excluded). Disbanding trades additional transient indexed storage (approximately 12 MB at 40,000 memberships) for eliminating repeated scans. This storage is discarded after the mutation. Store reopening still scans message IDs; this does not claim constant-time opening.
Functional checks preserve nested folds, filtering, phone/column geometry, live task ownership, recursive disbanding, unaffected shared memberships and history. Store tests exercise public Open → Sessions behavior, preserving titles/tags/surfaces/timestamps, unusual IDs and backfill after a later legacy writer. Focused race checks passed for the changed store, team and Activity paths.
The live 120-member workflow passed manager preview, pointer burst, physical scrolling, resize and opening the clicked member. All 5 completed model requests were verified as OpenRouter
deepseek/deepseek-v4.1-flash, including auxiliary calls. Navigation/startup measurements made zero model calls.make pr-readypassed: every selected test passed on its first run. All final-head GitHub gates passed, including build, vet, formatting, manual/law checks and the touched backend/TUI suites.After
make build, reproduce with:Capacity tests use mock records and an endpoint that rejects chat calls. Only the live workflow requires a configured OpenRouter key. Use identical test/benchmark fixtures with each revision for comparisons. The capacity Activity scenario now quits normally before fixture removal.
Standards
Independent review: 0 findings. Stable task slots, independently copied conversation overlays and kind-gated payload access preserve layout ownership. Existing modules and indexes are reused; no speculative abstraction was added.
Spec
Independent review: 0 findings. The changes match the requested efficiency/modularity cleanup and retain existing user behavior and public interfaces. Actual-terminal and exact-model acceptance passed.
Checklist
29e3f74eb; the merged build and actual-terminal Activity check passed (median 52 ms, p95 62 ms; zero model calls).