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:
@@ -123,6 +123,7 @@ func (m *Model) refreshLive() {
|
||||
ordered = filterSites(ordered, m.filterText)
|
||||
}
|
||||
m.sites = ordered
|
||||
m.buildMaintSet()
|
||||
m.refreshLogContent()
|
||||
|
||||
if m.selectedID != 0 {
|
||||
|
||||
Reference in New Issue
Block a user