lnd
lnd copied to clipboard
channeldb: update payment status instead of full re-fetch to improve performance
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%.
Visit https://dashboard.github.orijtech.com?back=0&pr=5769&remote=true&repo=bhandras%2Flnd to see benchmark details.
With Prefetch added the win is small but noticable using etcd. Should help more with postgres.
@bhandras, remember to re-request review from reviewers when ready
@bhandras, remember to re-request review from reviewers when ready
@bhandras, remember to re-request review from reviewers when ready
Closing due to inactivity
Closing due to inactivity
Closing due to inactivity