Drop the `dist` `HashMap` in routing, replacing it with a `Vec`.
authorMatt Corallo <git@bluematt.me>
Tue, 19 Mar 2024 22:26:37 +0000 (22:26 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 20 Mar 2024 00:51:20 +0000 (00:51 +0000)
commit5b7f0a287d0ab1129e205c4455689835929518ab
treef85538720dfdec7af41da19395125900e6f26ce1
parent7fa6e89765f49fca741994f5ba9b2e1658bb3679
Drop the `dist` `HashMap` in routing, replacing it with a `Vec`.

Now that we have unique, dense, 32-bit identifiers for all the
nodes in our network graph, we can store the per-node information
when routing in a simple `Vec` rather than a `HashMap`. This avoids
the overhead of hashing and table scanning entirely, for a nice
"simple" optimization win.
lightning/src/routing/gossip.rs
lightning/src/routing/router.rs
lightning/src/util/test_utils.rs