HomePhabricator

Bench: Add mempool eviction benchmark for chained tx's

Description

Bench: Add mempool eviction benchmark for chained tx's

Summary:

This is from my work in my mempool branch. By popular demand, I am
porting it over to here.

This benchmark is specifically for benchmarking chained_tx eviction
(regular eviction is already being benchmarked in a file called
`mempool_eviction.cpp`).

Notes:

To really test pathological eviction in `CTxMemPool` you need to do it with
a full mempool (100k+ tx's) of sets of chained tx's (this bench uses sets of
50-tx chains, 2000 of them!). The philosophy behind this bench is that we must
design for the worst case when benchmarking here.

This benchmark is very heavy in terms of setup cost -- it actually takes a long
time to run the setup in order to be able to *properly* bench `CTxMemPool`'s
eviction under mempool-pressure circumstances.

Most of the time the benchmark is setting up the mempool(s) it will use.
The actual iteration code (which is what gets timed) is very minor as
compared to the setup. This is because mempool accept is terribly slow
in `CTxMemPool` for unconfirmed chains.

Port of bchn#1098.

Depends on D13106.

Test Plan:

ninja bench-bitcoin

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Subscribers: sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D13107

Details

Provenance
CCulianuAuthored on Feb 6 2023, 19:32
FabienCommitted on Feb 7 2023, 19:08
FabienPushed on Feb 7 2023, 19:08
Reviewer
Restricted Project
Differential Revision
D13107: Bench: Add mempool eviction benchmark for chained tx's
Parents
rABCf2e99cae0737: bench: Reorg benchmarks without mempool removal
Branches
Unknown
Tags
Unknown