Skip to content

Speed up the Sessions locale hit-testing suite - #122

Merged
merefield merged 1 commit into
mainfrom
perf/localised-session-hit-testing
Nov 27, 2026
Merged

merefield merged 1 commit into
mainfrom
perf/localised-session-hit-testing

Conversation

@merefield

@merefield merefield commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Why

The macOS v0.36.0 release localisation job timed out twice without reporting a failed assertion. The largest measured hotspots were approval-target checks and long wrapped-composer checks, which probe many cells in one unchanged frame for every locale. The release-only timeout adjustment is already on main and is not part of this PR.

Changes

  • Reuse dashboard, detail-control and approval geometry while checking a fixed screen. Every existing per-cell assertion and real approval click remains.
  • Start a fresh read-only pass for live events and add regression coverage for an approval that disappears between passes. There is no cache across live events and no change to approval validation.
  • Keep all 17 locale subprocesses, the race detector, coverage and the existing PR timeout.

Local measurements

Five runs on the same Linux checkout with race detection and coverage: approval rendered targets went from about 4.3 s to 1.4 s per run, and wrapped composer hit targets from 4.7 s to 1.0 s. GitHub CI will measure the effect on macOS and the complete locale matrix.

Verification

  • Targeted race-and-coverage tests for the changed paths, expired approval, composer and drag-copy passed.
  • The complete 17-locale suite passed locally on the final commit with race detection and coverage.
  • Go vet, screenshot verification and the production duplication gate passed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain, and the changes address geometry caching and hit-testing regressions while preserving fresh validation for live input and approvals.

No open issues 🎉

What changed in this PR

This pull request speeds up the Sessions locale hit-testing suite by caching geometry during unchanged render and hit-test passes while preserving fresh passes for live input and approval validation.

Changes:

  • Adds pass-local caches for dashboard, detail-control, approval-button, and monitor-area geometry.
  • Updates locale hit-testing tests to reuse cached geometry across repeated cell checks.
  • Adds regression coverage for approvals that disappear between hit-testing passes.
File Description
internal/​ui/​monitor_summary.go Defines reusable pass-local geometry cache structures and size-keyed layout caching.
internal/​ui/​monitor_prompt_test.go Reuses one hit-test pass for wrapped composer assertions.
internal/​ui/​monitor_efficiency_test.go Adds geometry-equivalence and expired-approval regression tests.
internal/​ui/​monitor_detail_activity.go Caches detail-control layout calculations during a geometry pass.
internal/​ui/​monitor_context.go Creates fresh hit-test passes and reuses cached approval-button geometry.
internal/​ui/​monitor_approval_test.go Reuses one hit-test pass for rendered approval target assertions.
internal/​ui/​model.go Caches the base dashboard layout during a geometry pass.

Review effort: Lite

@merefield
merefield merged commit 5f4e397 into main Nov 27, 2026
9 checks passed
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.

2 participants