Description
Deserializing the network graph takes quite a while, of which my initial testing shows 80+% of the time is spent deserializing the publickeys from compressed 33-byte form into secp 64-byte form (and presumably verifying they are on the curve). There is relatively little reason to be verifying all the public keys, let alone using them in 64 byte format everywhere in the network graph in memory. We should instead simply use [u8; 33]
for them, checking their correctness only after we've built a route with them and need to construct a Route
object. Note that I'd think this may also represent a material speedup for route finding as pubkey comparison can be inlined instead of needing to call out to C code due to lack of cross-language LTO in most builds.