Files
lnd.xprv/autopilot
Johan T. Halseth 4ac3c171ec autopilot/choice: avoid costly map allocations
This commit makes the weightedChoice algorithm take a slice of weights
instead of a map of node scores. This let us avoid costly map allocation
and iteration.

In addition we make the chooseN algorithm keep track of the remaining
nodes by keeping a slice of weights through its entire run, similarly
avoiding costly map allocation and iteration.

In total this brings the runtime of the TestChooseNSample testcase down
from ~73s to ~3.6s.
2018-12-19 08:27:34 +01:00
..
2018-12-19 08:27:34 +01:00
2018-12-10 15:01:43 +01:00
2018-12-13 12:26:29 +01:00