Somewhat optimize the generic `Features::requires_unknown_bits`
authorMatt Corallo <git@bluematt.me>
Fri, 8 Dec 2023 05:44:32 +0000 (05:44 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 10 Dec 2023 03:56:58 +0000 (03:56 +0000)
commit0b7d73117c173429d04000e5799bf577062c70fd
tree40c521e02efb23622a332e8996e975506d906089
parent668bf9b94cf086277a951daedec529425002b047
Somewhat optimize the generic `Features::requires_unknown_bits`

It turns out we spend several percent of our routefinding time just
checking if nodes and channels require unknown features
byte-by-byte. While the cost is almost certainly dominated by the
memory read latency, avoiding doing the checks byte-by-byte should
reduce the branch count slightly, which may reduce the overhead.
lightning/src/ln/features.rs