mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 15:28:03 +00:00
33 lines
901 B
C++
33 lines
901 B
C++
#include <xrpl/basics/Slice.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
|
|
credentialKeyletImpl(benchmark::State& state)
|
|
{
|
|
static constexpr auto kWasmName = std::string_view{"credential_id"};
|
|
static constexpr auto kType = std::string_view{"termsandconditions"};
|
|
|
|
benchmarkImpl(
|
|
state,
|
|
kWasmName,
|
|
[] { return Fixtures::instance().host(); },
|
|
[](auto& host) {
|
|
return host.credentialKeylet(
|
|
Fixtures::instance().alice().id(),
|
|
Fixtures::instance().bob().id(),
|
|
Slice{kType.data(), kType.size()});
|
|
});
|
|
}
|
|
BENCHMARK(credentialKeyletImpl)->UseManualTime()->Iterations(kBenchIterations);
|
|
|
|
} // namespace
|
|
} // namespace xrpl::test::bench
|