Skip to content
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

Basic performance analysis #1809

Closed
wants to merge 12 commits into from
Closed

Basic performance analysis #1809

wants to merge 12 commits into from

Conversation

pm47
Copy link
Member

@pm47 pm47 commented May 17, 2021

Added a very simple performance test and applied a few "optimizations" to try and pinpoint performance bottlenecks.

Here are the results:

incremental change result
baseline 1000 payments in 72078ms 13htlc/s (senders=8)
store asynchronously 1000 payments in 72078ms 13htlc/s (senders=8)
update sqlite to 3.34.0 1000 payments in 72078ms 13htlc/s (senders=8)
bypass htlc_infos db writes 1000 payments in 78584ms 12htlc/s (senders=8)
bypass payments db calls 1000 payments in 43378ms 23htlc/s (senders=8)
store only the channels commitment 1000 payments in 41594ms 24htlc/s (senders=8)
serialize channel data but do not store it 1000 payments in 18072ms 55htlc/s (senders=8)
bypass channel db writes 1000 payments in 20479ms 48htlc/s (senders=8)
bypass pending relay db calls 1000 payments in 15181ms 65htlc/s (senders=8)
use multiple channels in parallel 1000 payments in 14812ms 67htlc/s (senders=8)

First thing to do imo is rearchitecture the payments handler, probably with payment_hash-indexed child actors, like we do for relayers. This will make us gain 2x, maybe more if it allows us to take full advantage of multiple channels (which we don't currently, see last test).

Further improvements won't be as simple, but at least we know where the gains are.

pm47 added 4 commits May 16, 2021 18:49
NB: some tests do not pass because they rely on `sender()` which doesn't
work with akka typed.
@pm47 pm47 force-pushed the optim-benchmark branch 2 times, most recently from 894c603 to 0f60336 Compare May 17, 2021 12:53
@pm47
Copy link
Member Author

pm47 commented May 17, 2021

Added more intermediate steps which show that splitting the local_channels in columns and only updating the commitments part do not change the results.

@pm47 pm47 force-pushed the optim-benchmark branch from 0f60336 to 3632dac Compare May 17, 2021 13:16
@pm47 pm47 force-pushed the optim-benchmark branch from 3632dac to 541cfc2 Compare May 17, 2021 13:18
@pm47
Copy link
Member Author

pm47 commented Jul 15, 2021

Follow up in #1871.

@pm47 pm47 closed this Jul 15, 2021
@t-bast t-bast deleted the optim-benchmark branch December 15, 2021 09:46
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.

1 participant