Skip to content

Router benchmark improvements #1275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Jan 24, 2022

Refactor the generate_routes and generate_mpp_routes benchmarks in order to:

  • remove code duplication
  • support any Score implementation
  • cover first_hops parameter
  • seeding the scorer with success and failure data

Adds a benchmark for a zero-penalty scorer to establish a baseline.

Broken out from #1227.

Refactor generate_routes and generate_mpp_routes into a single utility
for benchmarking. The utility is parameterized with features in order to
test both single path and multi-path routing. Additionally, it is
parameterized with a Score to be used with other scorers.
Passing first_hops to get_route increases the coverage of the benchmark
test. For scorers needing the sending node, it allows for using a single
scorer in the benchmark rather than re-initializing on each iteration.
As a consequence, the scorer can be seeded with success and failure
data.
Scorers may have different performance characteristics after seeing
failed and successful paths. Seed the scorer with some random data
before executing the benchmark in order to exercise such behavior.
@jkczyz jkczyz force-pushed the 2022-01-benchmark-improvements branch from ba8d084 to d924c5d Compare January 25, 2022 01:33
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2022

Codecov Report

Merging #1275 (d924c5d) into main (35d4ebb) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1275   +/-   ##
=======================================
  Coverage   90.38%   90.39%           
=======================================
  Files          71       71           
  Lines       38135    38135           
=======================================
+ Hits        34470    34471    +1     
+ Misses       3665     3664    -1     
Impacted Files Coverage Δ
lightning/src/routing/router.rs 91.81% <ø> (ø)
lightning/src/ln/functional_tests.rs 97.28% <0.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35d4ebb...d924c5d. Read the comment docs.

@valentinewallace valentinewallace merged commit 1a24dcc into lightningdevkit:main Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants