Page MenuHomePhabricator

Speedup coinselector_tests by using a dummy WalletDBWrapper when apropriate
ClosedPublic

Authored by deadalnix on Jun 22 2019, 01:23.

Details

Summary

Since the addition of AddToWallet to add_coin, some test became significantly slower due to an increase in operation done on the mock DB. Using a dummy DB when the mock is not required speeds things up dramatically.

Test Plan
perf -g -- src/test/test_bitcoin -t coinselector_tests
perf report

Make sure that the majority of the time isn't spent in BDB anymore.

Diff Detail

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

Event Timeline

JFC this test is slow without this patch. >_<

From what I can see, Core used a dummy wallet from the very start. Why is ours different? It looks like the backport D3252 got modified from the original somehow.

This revision is now accepted and ready to land.Jun 24 2019, 10:11