bitcoindevkit / bitcoindevkit/coin-select

Performance Measurments Slow

Open
#80 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
18
Forks
14
PR merge metrics
No merged PRs in 30d

Description

I recently ran a comparison between different coin-selection implementations, namely bitcoin-core, rust-bitcoin-coin-selection and this crate, bdk coin select. In so doing, I noticed BDK coin-select is slow, like really really slow.

These are the numbers I recently recorded:
| implementation | interface | pool size|ns/select |
|------------------------|---------------------|----------|----------|
| bitcoin-coin-selection | select_coins() | 400 |862,910 |
| bitcoin core | AttemptSelection() | 400 |16,695,408|
| bdk coin-select | run_bnb(lowest_fee) | 50 |30,202,000|

To make matters worse, both bitcoin-core and bitcoin-coin-selection actually run the interface in a loop [10 times](https://github.com/bitcoin/bitcoin/blob/59224b66aa1db43adc61c15ee41b413951f22f80/src/bench/coin_selection.cpp#L133) for each measurement.

For more details on the measurements, see my PR for adding coin-selection Criterion measurements [here](https://github.com/p2pderivatives/rust-bitcoin-coin-selection/pull/320).

Hopefully these findings can help you all in fine tuning the performance of this crate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Criterion measurements described in the linked rust-bitcoin-coin-selection PR, focusing on the bdk coin-select run_bnb(lowest_fee) case and the reported pool sizes. Compare its results with the other implementations and identify the source of the slowdown; done means the measurements improve and the benchmark results document the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.