3#include <benchmark/benchmark.h>
6using namespace benchmark;
10void asm_add_with_coarse_reduction(State& state)
noexcept
13 for (
auto _ : state) {
14 DoNotOptimize(fr::asm_add_with_coarse_reduction(x, y));
19void asm_conditional_negate(State& state)
noexcept
22 for (
auto _ : state) {
23 fr::asm_conditional_negate(x,
true);
28void asm_mul_with_coarse_reduction(State& state)
noexcept
31 for (
auto _ : state) {
32 DoNotOptimize(fr::asm_mul_with_coarse_reduction(x, y));
37void asm_reduce_once(State& state)
noexcept
40 for (
auto _ : state) {
41 DoNotOptimize(fr::asm_reduce_once(x));
46void asm_self_add_with_coarse_reduction(State& state)
noexcept
49 for (
auto _ : state) {
50 fr::asm_self_add_with_coarse_reduction(x, y);
53BENCHMARK(asm_self_add_with_coarse_reduction);
55void asm_self_mul_with_coarse_reduction(State& state)
noexcept
58 for (
auto _ : state) {
59 fr::asm_self_mul_with_coarse_reduction(x, y);
62BENCHMARK(asm_self_mul_with_coarse_reduction);
64void asm_self_reduce_once(State& state)
noexcept
67 for (
auto _ : state) {
68 fr::asm_self_reduce_once(x);
73void asm_self_sqr_with_coarse_reduction(State& state)
noexcept
76 for (
auto _ : state) {
77 fr::asm_self_sqr_with_coarse_reduction(x);
80BENCHMARK(asm_self_sqr_with_coarse_reduction);
82void asm_self_sub_with_coarse_reduction(State& state)
noexcept
85 for (
auto _ : state) {
86 fr::asm_self_sub_with_coarse_reduction(x, y);
89BENCHMARK(asm_self_sub_with_coarse_reduction);
91void asm_sqr_with_coarse_reduction(State& state)
noexcept
94 for (
auto _ : state) {
95 DoNotOptimize(fr::asm_sqr_with_coarse_reduction(x));
100void mul(State& state)
noexcept
103 for (
auto _ : state) {
104 DoNotOptimize(x * y);
109void self_mul(State& state)
noexcept
112 for (
auto _ : state) {
118void add(State& state)
noexcept
121 for (
auto _ : state) {
122 DoNotOptimize(x + y);
127void self_add(State& state)
noexcept
130 for (
auto _ : state) {
136void sub(State& state)
noexcept
139 for (
auto _ : state) {
140 DoNotOptimize(x - y);
145void self_sub(State& state)
noexcept
148 for (
auto _ : state) {
154void invert(State& state)
noexcept
157 for (
auto _ : state) {
158 DoNotOptimize(x.
invert());
163void self_neg(State& state)
noexcept
166 for (
auto _ : state) {
172void self_reduce_once(State& state)
noexcept
175 for (
auto _ : state) {
181void self_to_montgomery_form(State& state)
noexcept
184 for (
auto _ : state) {
190void self_sqr(State& state)
noexcept
193 for (
auto _ : state) {
199void sqr(State& state)
noexcept
202 for (
auto _ : state) {
203 DoNotOptimize(x.
sqr());
Entry point for Barretenberg command-line interface.
BENCHMARK(bench_commit_structured_random_poly< curve::BN254 >) -> Unit(benchmark::kMillisecond)
BB_INLINE constexpr void self_reduce_once() &noexcept
BB_INLINE constexpr void self_sqr() &noexcept
constexpr field invert() const noexcept
BB_INLINE constexpr void self_neg() &noexcept
BB_INLINE constexpr field sqr() const noexcept
BB_INLINE constexpr void self_to_montgomery_form() &noexcept