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>
Wed, 20 Mar 2024 00:51:20 +0000 (00:51 +0000)
commit494e94087c9744b3702b36b67f5c5c13915dc356
tree9ffc07092c6edba27469637f5c5d3e3cab266cd6
parent1f3c5e82a0197a9ba92adedb56f152b2e49cf57c
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