routing: make log in findPath hot path use logClosure
It generates heap allocations for it's params even if it won't end up using them. Reduces memory usage by 2mb
This commit is contained in:
parent
a469d5dc2c
commit
5389161162
@ -448,8 +448,11 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
|
||||
fromVertex, toNode, amountToSend,
|
||||
)
|
||||
|
||||
log.Tracef("path finding probability: fromnode=%v, tonode=%v, "+
|
||||
"probability=%v", fromVertex, toNode, edgeProbability)
|
||||
log.Trace(newLogClosure(func() string {
|
||||
return fmt.Sprintf("path finding probability: fromnode=%v,"+
|
||||
" tonode=%v, probability=%v", fromVertex, toNode,
|
||||
edgeProbability)
|
||||
}))
|
||||
|
||||
// If the probability is zero, there is no point in trying.
|
||||
if edgeProbability == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user