optimization: generate children counts on demand

Accumulating counts in the Node data structure takes a lot of effort,
and it turns out we only use this information in a few places where
it's easy to compute.
This commit is contained in:
Bryan Boreham
2020-06-08 16:42:24 +00:00
parent d76da767d8
commit 6a6ef51ef5
5 changed files with 20 additions and 28 deletions

View File

@@ -193,9 +193,6 @@ func (ret *joinResults) addUnmappedChild(m report.Node, id string, topology stri
result = report.MakeNode(id).WithTopology(topology)
}
result = result.WithChildID(m.ID)
if m.Topology != report.Endpoint { // optimisation: we never look at endpoint counts
result = result.AddCounter(m.Topology, 1)
}
ret.nodes[id] = result
}