bench: Remove WalletLoadingLegacy benchmark

This commit is contained in:
Ava Chow 2024-01-05 18:42:12 -05:00
parent 56f959d829
commit 5e93b1fd6c

View file

@ -4,7 +4,6 @@
#include <addresstype.h> #include <addresstype.h>
#include <bench/bench.h> #include <bench/bench.h>
#include <bitcoin-build-config.h> // IWYU pragma: keep
#include <consensus/amount.h> #include <consensus/amount.h>
#include <outputtype.h> #include <outputtype.h>
#include <primitives/transaction.h> #include <primitives/transaction.h>
@ -32,7 +31,7 @@ static void AddTx(CWallet& wallet)
wallet.AddToWallet(MakeTransactionRef(mtx), TxStateInactive{}); wallet.AddToWallet(MakeTransactionRef(mtx), TxStateInactive{});
} }
static void WalletLoading(benchmark::Bench& bench, bool legacy_wallet) static void WalletLoadingDescriptors(benchmark::Bench& bench)
{ {
const auto test_setup = MakeNoLogFileContext<TestingSetup>(); const auto test_setup = MakeNoLogFileContext<TestingSetup>();
@ -42,10 +41,7 @@ static void WalletLoading(benchmark::Bench& bench, bool legacy_wallet)
// Setup the wallet // Setup the wallet
// Loading the wallet will also create it // Loading the wallet will also create it
uint64_t create_flags = 0; uint64_t create_flags = WALLET_FLAG_DESCRIPTORS;
if (!legacy_wallet) {
create_flags = WALLET_FLAG_DESCRIPTORS;
}
auto database = CreateMockableWalletDatabase(); auto database = CreateMockableWalletDatabase();
auto wallet = TestLoadWallet(std::move(database), context, create_flags); auto wallet = TestLoadWallet(std::move(database), context, create_flags);
@ -68,11 +64,5 @@ static void WalletLoading(benchmark::Bench& bench, bool legacy_wallet)
}); });
} }
#ifdef USE_BDB
static void WalletLoadingLegacy(benchmark::Bench& bench) { WalletLoading(bench, /*legacy_wallet=*/true); }
BENCHMARK(WalletLoadingLegacy, benchmark::PriorityLevel::HIGH);
#endif
static void WalletLoadingDescriptors(benchmark::Bench& bench) { WalletLoading(bench, /*legacy_wallet=*/false); }
BENCHMARK(WalletLoadingDescriptors, benchmark::PriorityLevel::HIGH); BENCHMARK(WalletLoadingDescriptors, benchmark::PriorityLevel::HIGH);
} // namespace wallet } // namespace wallet