HomePhabricator

Improve mempool trimming performance

Description

Improve mempool trimming performance

Summary:
The trimming algorithm will happily copy all the transactions that are getting evicted so they can be parsed and the coin view updated. This is due to the algorithm being written prior to the existence of CTransactionRef, aka shared_ptr<const CTransaction>, which will let us hold the pointer instead even after the transaction has been removed from the mempool.

Note that the MempoolEviction benchmark does not show any significant performance difference with previous code (increase the benchmark min time, see D12903).

There is no change in behavior.

Test Plan:

ninja check-extended

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Dec 16 2022, 17:08
FabienPushed on Dec 19 2022, 08:17
Reviewer
Restricted Project
Differential Revision
D12904: Improve mempool trimming performance
Parents
rABCde6591d73286: bench: update nanobench add -min_time
Branches
Unknown
Tags
Unknown