Skip to content

Use parallel iter for finding inputs/outputs

Dagur Valberg Johannsson requested to merge github/fork/dagurval/rayon into master

Created by: dagurval

Finding inputs/outputs for get history calls is CPU intensive. Use parallel iter to speed up the query.

Simple benchmarking shows 3x speedup on my laptop for large histories, such as the eatbch address.

Test plan

Run the following with and without this change. This is the eatbch address which has about 13k transactions associated with it.

contrib % time python3 client.py --server localhost blockchain.address.get_history bitcoincash:pp8skudq3x5hzw8ew7vzsw8tn4k8wxsqsv0lt0mf3g > /dev/null

On my laptop, with this change 0.07s user 0.03s system 5% cpu 1.721 total

Without this change: 0.07s user 0.02s system 1% cpu 4.885 total

Merge request reports