Files
rippled/src/benchmarks/libxrpl/wasm/host_functions/CacheLedgerObj.cpp
2026-09-02 17:03:47 -04:00

29 lines
738 B
C++

#include <xrpl/protocol/Indexes.h>
#include <benchmark/benchmark.h>
#include <benchmarks/libxrpl/wasm/BenchFixtures.h>
#include <benchmarks/libxrpl/wasm/WasmBench.h>
#include <string_view>
namespace xrpl::test::bench {
namespace {
void
cacheLedgerObjImpl(benchmark::State& state)
{
static constexpr auto kWasmName = std::string_view{"cache_le"};
auto const key = keylet::account(Fixtures::instance().alice().id()).key;
benchmarkImpl(
state,
kWasmName,
[] { return Fixtures::instance().host(); },
[&key](auto& host) { return host.cacheLedgerObj(key, 1); });
}
BENCHMARK(cacheLedgerObjImpl)->UseManualTime()->Iterations(kBenchIterations);
} // namespace
} // namespace xrpl::test::bench