Roman Zeyde
Roman Zeyde
I have split the content of this PR into 2 commits: - 784459ac79 is adding the new `/rest/txfromblock/` endpoint - 1b928f58fc is adding an optional `locationsindex` for optimizing lookups
Many thanks for the review! Applied the comments: [`1b928f5 -> b2a22ce`](https://github.com/bitcoin/bitcoin/compare/1b928f58fc78f4727cef988902075abc05c372b2..b2a22ce33dc69697181547fa1e83bd0ed3321565)
Applied a few more fixes: [`b2a22ce -> 4441827`](https://github.com/bitcoin/bitcoin/compare/b2a22ce33dc69697181547fa1e83bd0ed3321565..4441827ef4e9b5fe306c5f0a81a52b5d2b5e0b69)
Many thanks for the review and the suggested fixes! Squashed most the fixes into the above commits and force-pushed: https://github.com/bitcoin/bitcoin/compare/4441827ef4e9b5fe306c5f0a81a52b5d2b5e0b69...5e1c80a22f3d3c6ecf6d4e2777d67656423dd3f3
Rebasing to resolve a conflict with `master`.
> Are you seeing greater improvements on other setups? I think that the performance gain will increase when fetching transactions near the end of the block. For example, when fetching...
Ran the same test using `hey` 0.1.4 - enabling `locationsindex` improves the performance ~15.8x (2.963ms → 0.187ms) Details ## `-locationsindex=1` ``` hey -c 1 -n 10000 http://localhost:8332/rest/txfromblock/$BLOCKHASH-5000.bin Summary: Total: 1.8766...
Also tested with [`wrk`](https://github.com/wg/wrk) 4.1.0, with similar performance improvement. Details ## `-locationsindex=1` ``` $ wrk --latency -t 1 -c 1 -d 10s http://localhost:8332/rest/txfromblock/$BLOCKHASH-5000.bin Running 10s test @ http://localhost:8332/rest/txfromblock/000000000000000000017bfd05b5fa367a424c4a565a4baf7950d9e8605df8ec-5000.bin 1 threads...