perf(tui): precompute maintenance set, eliminate redundant GetAllSites
CI / test (pull_request) Successful in 1m45s
CI / lint (pull_request) Successful in 1m16s
CI / vulncheck (pull_request) Successful in 46s

Replace O(windows × sites) isMonitorInMaintenance with O(1) map lookup.
buildMaintSet runs once per refreshLive/handleTabData, not per call site.

groupSparkline/groupUptime now use m.sites (already on model) instead of
calling engine.GetAllSites() which copies the full map under a mutex.
This commit was merged in pull request #172.
This commit is contained in:
2026-07-01 19:37:27 -04:00
parent b90033c7f0
commit a32a443a4a
6 changed files with 103 additions and 10 deletions
+1
View File
@@ -123,6 +123,7 @@ func (m *Model) refreshLive() {
ordered = filterSites(ordered, m.filterText)
}
m.sites = ordered
m.buildMaintSet()
m.refreshLogContent()
if m.selectedID != 0 {