Compile two versions of bitcoind, one with this patch and the other without,
then record timings for fetching the mempool via REST.
```
git ch master
ninja bitcoind bitcoin-cli
bitcoind -rest -connect=0 # -connect=0 ensures we do not download any new transactions while testing
bitcoin-cli invalidateblock 000000000000000000e311a3b4f53085a427a22dcc8c790b266d9f882c795564 # some block that is not recent
bitcoin-cli getmempoolinfo # confirm you have at least thousands of txs in the mempool
for X in {1..100} ; do { time curl localhost:8332/rest/mempool/contents.json ; } 2>> results-without-patch ; done
git ch <this-patch>
ninja bitcoind bitcoin-cli
bitcoind -rest -connect=0 # -connect=0 ensures we do not download any new transactions while testing
bitcoin-cli getmempoolinfo # confirm you have the same number of transactions in the mempool as the previous test
for X in {1..100} ; do { time curl localhost:8332/rest/mempool/contents.json ; } 2>> results-with-patch ; done
```
Now compare the average of the timings:
```
cat results-without-patch | grep real | sed 's/real[ \t]//g' | sed 's/[ms]//g' | awk '{total+=$1; count+=1} END {print total/count}'
cat results-with-patch | grep real | sed 's/real[ \t]//g' | sed 's/[ms]//g' | awk '{total+=$1; count+=1} END {print total/count}'
```
My results:
Without patch: `0.32937`
With patch: `0.17476`
**~47% improvement!**