]> git.bitcoin.ninja Git - rust-lightning/commit
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, 10 Jul 2024 19:38:02 +0000 (19:38 +0000)
commit9566c272c8f2109aeee6628d74dc5b3eecb427e1
tree7e48225d3ade9673b8ef3ab7cf53cdb2c5aeb436
parent98f9e8bbf80c5f7d3bb37da92aef0f12d57c075f
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