perf(tui): precompute maintenance set, eliminate redundant GetAllSites
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:
@@ -207,6 +207,7 @@ type Model struct {
|
||||
lastTabLoad time.Time // last dispatch of loadTabDataCmd (throttle)
|
||||
tabSeq int // seq of the newest issued tab-data load
|
||||
|
||||
maintSet map[int]bool
|
||||
bottomPanel bottomPanel
|
||||
detailOpen bool
|
||||
maintCursor int
|
||||
|
||||
Reference in New Issue
Block a user