mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-04 10:48:15 +00:00
32 lines
849 B
C++
32 lines
849 B
C++
#include <xrpl/protocol/Asset.h>
|
|
#include <xrpl/protocol/Issue.h>
|
|
#include <xrpl/protocol/UintTypes.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
|
|
ammKeyletImpl(benchmark::State& state)
|
|
{
|
|
static constexpr auto kWasmName = std::string_view{"amm_id"};
|
|
|
|
auto const usd = Asset{Issue{toCurrency("USD"), Fixtures::instance().alice().id()}};
|
|
auto const xrp = Asset{xrpIssue()};
|
|
|
|
benchmarkImpl(
|
|
state,
|
|
kWasmName,
|
|
[] { return Fixtures::instance().host(); },
|
|
[&usd, &xrp](auto& host) { return host.ammKeylet(usd, xrp); });
|
|
}
|
|
BENCHMARK(ammKeyletImpl)->UseManualTime()->Iterations(kBenchIterations);
|
|
|
|
} // namespace
|
|
} // namespace xrpl::test::bench
|