Don't clone Features during Dijkstras graph walk
authorMatt Corallo <git@bluematt.me>
Fri, 5 Mar 2021 02:42:42 +0000 (21:42 -0500)
committerMatt Corallo <git@bluematt.me>
Wed, 7 Apr 2021 01:41:45 +0000 (21:41 -0400)
commit4c754372628ed155f4babf9f443e05f13481b0f7
tree3ae6e9c8e9d47c7166283c6ae43576b13be49bf9
parent0d7c316259b383ab5f374af619ab440ef93dd03b
Don't clone Features during Dijkstras graph walk

We currently copy the features objects in each channel as we walk
the graph during route calculation. This implies a significant
amount of malloc traffic as the features flags object are stored
on the heap.

Instead, because they features being referenced are in the network
graph which we hold a reference to, we can simply store references
to them.

This nontrivially improves our get_route benchmark by around 5%.
lightning/src/routing/router.rs