Page MenuHomePhabricator

[backport#17292] Add new mempool benchmarks for a complex pool
ClosedPublic

Authored by majcosta on Sep 10 2020, 16:45.

Details

Summary

Add new mempool benchmarks for a complex pool (Jeremy Rubin)

Pull request description:

This PR is related to #17268.

It adds a mempool stress test which makes a really big complicated tx graph, and then, similar to mempool_eviction test, trims the size.

The test setup is to make 100 original transactions with Rand(10)+2 outputs each.

Then, 800 times:

we create a new transaction with Rand(10) + 1 parents that are randomly sampled from all existing transactions (with unspent outputs). From each such parent, we then select Rand(remaining outputs) +1 50% of the time, or 1 outputs 50% of the time.

Then, we trim the size to 3/4. Then we trim it to just a single transaction.

This creates, hopefully, a big bundle of transactions with lots of complex structure, that should really put a strain on the mempool graph algorithms.

This ends up testing both the descendant and ancestor tracking.

I don't love that the test is "unstable". That is, in order to compare this test to another, you really can't modify any of the internal state because it will have a different order of invocations of the deterministic randomness. However, it certainly suffices for comparing branches.

Top commit has no ACKs.


Backport of Core PR17292 and PR17349 (to unbreak PR17292)

Rationale: On PR17292, struct 'Available' does not follow the rule-of-three with raises a compiler warning that our CI treats with -Werror (it has a user-defined copy-assignment operator without respective copy-constructor and destructor), so I removed it since no deep-copy behavior was required. Noticing that PR17349 did that plus removed a spurious copy-constructor from src/psbt.h, I decided that was reason enough to squash the two PR's together instead of submitting a modified version of each.

Test Plan
ninja check check-functional
bitcoin-bench -filter=ComplexMemPool

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Sep 10 2020, 18:37