lnd icon indicating copy to clipboard operation
lnd copied to clipboard

channeldb: update payment status instead of full re-fetch to improve performance

Open bhandras opened this issue 4 years ago • 3 comments

This PR adds a small refactor to reduce the number of times we fetch payments where we have all information already in memory.

Tested with Postgres since this change adds the most there (reducing roundtrips):

=== RUN   TestLightningNetworkDaemon/tranche00/37-of-84/btcd/async_payments_benchmark
    test_harness.go:122:     Benchmark info: Elapsed time:  22.477978694s
    test_harness.go:122:     Benchmark info: TPS:  21.48769720690794
--- PASS: TestLightningNetworkDaemon (33.91s)


=== RUN   TestLightningNetworkDaemon
=== RUN   TestLightningNetworkDaemon/tranche00/37-of-84/btcd/async_payments_benchmark
    test_harness.go:122:     Benchmark info: Elapsed time:  20.761933216s
    test_harness.go:122:     Benchmark info: TPS:  23.263729585055227
--- PASS: TestLightningNetworkDaemon (30.79s)

About 1.78 TPS more, which equals to a speed up of roughly 8%.

bhandras avatar Sep 20 '21 09:09 bhandras

Visit https://dashboard.github.orijtech.com?back=0&pr=5769&remote=true&repo=bhandras%2Flnd to see benchmark details.

orijbot avatar Sep 20 '21 09:09 orijbot

With Prefetch added the win is small but noticable using etcd. Should help more with postgres.

bhandras avatar Sep 20 '21 14:09 bhandras

@bhandras, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Sep 13 '22 06:09 lightninglabs-deploy

@bhandras, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Nov 15 '22 11:11 lightninglabs-deploy

@bhandras, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Jul 25 '23 11:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 13:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 14:07 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Jul 28 '23 15:07 lightninglabs-deploy