Skip to content

Conversation

joostjager
Copy link
Contributor

@joostjager joostjager commented Oct 15, 2025

This PR adds a new async payment benchmark test to integration_tests_rust.rs. The test sets up two nodes with a channel and measures performance while sending 1,000 concurrent payments. It uses Tokio’s multi-threaded runtime to spawn payments as separate async tasks and tracks completion through LDK events. The benchmark provides a simple way to gauge throughput and identify performance bottlenecks in payment handling.

Related: lightningdevkit/rust-lightning#4161

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Oct 15, 2025

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

To enable more realistic testing with sqlite as a backend.
@joostjager
Copy link
Contributor Author

Converted test to criterion benchmark and added it to CI. Also removed the payment throttling, now that it has been established that there is a bug in lightning-net-tokio that causes this. For the benchmark, the 1000 payments can now simply be launched at the same time.

Criterion reports outliers, so this should be able to detect to occassional 30 sec hangs in the payments test.

@joostjager joostjager marked this pull request as ready for review October 21, 2025 13:04
@joostjager joostjager requested a review from tnull October 21, 2025 13:04
Introduces a criterion-based benchmark that sends 1000 concurrent
payments between two LDK nodes to measure total duration. Also adds a
CI job to automatically run the benchmark.

[[bench]]
name = "payments"
path = "tests/benchmarks.rs"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't want to do the default benches folder, because so many test tools are reused.

use rand::RngCore;
use tokio::task::{self};

use crate::common::open_channel_push_amt;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving clean up to the weekly bot...

@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants