]> git.bitcoin.ninja Git - rust-lightning/commit
Pull the `linear_scoring` if out of the hot bucket iteration loop
authorMatt Corallo <git@bluematt.me>
Sat, 16 Dec 2023 01:52:44 +0000 (01:52 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 17 Jul 2024 14:38:03 +0000 (14:38 +0000)
commit897350e1acf71e93dd9406632d399504c51ef0d8
tree7a86a73a6dc51f1e25818ed36218f31e9e5954f6
parent1101240ec6e17a1db77691002bfc8d6e5bf81dfd
Pull the `linear_scoring` if out of the hot bucket iteration loop

Our loops iterating the scoring buckets are incredibly
performance-sensitive. Currently, inside them, we branch on whether
we're doing a linear or non-linear scoring, selecting a different
probability model depending on our parameters. While the branching
itself isnt' necessarily all that problematic, by pulling the
branching out of the loop we open up the possibility of future
optimizations on a per-model basis.
lightning/src/routing/scoring.rs