Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
fr.bench.cpp File Reference
#include "fr.hpp"
#include <benchmark/benchmark.h>

Go to the source code of this file.

Functions

void field_mixed_add (const fr &x1, const fr &y1, const fr &z1, const fr &x2, const fr &y2, fr &x3, fr &y3, fr &z3)
 
uint64_t rdtsc ()
 
fr sqr_assign_impl (const fr &x)
 
void sqr_assign_bench (State &state) noexcept
 
 BENCHMARK (sqr_assign_bench)
 
fr sqr_impl (const fr &x)
 
void sqr_bench (State &state) noexcept
 
 BENCHMARK (sqr_bench)
 
fr unary_minus_impl (const fr &x)
 
void unary_minus_bench (State &state) noexcept
 
 BENCHMARK (unary_minus_bench)
 
fr mul_assign_impl (const fr &x, const fr &y)
 
void mul_assign_bench (State &state) noexcept
 
 BENCHMARK (mul_assign_bench)
 
fr mul_impl (const fr &x, const fr &y)
 
void mul_bench (State &state) noexcept
 
 BENCHMARK (mul_bench)
 
fr self_add_impl (const fr &x, fr &y)
 
void self_add_bench (State &state) noexcept
 
 BENCHMARK (self_add_bench)
 
fr add_impl (const fr &x, fr &y)
 
void add_bench (State &state) noexcept
 
 BENCHMARK (add_bench)
 
fr sub_impl (const fr &x, fr &y)
 
void sub_bench (State &state) noexcept
 
 BENCHMARK (sub_bench)
 
fr addaddmul_impl (const fr &x, const fr &y, const fr &z)
 
void addaddmul_bench (State &state) noexcept
 
 BENCHMARK (addaddmul_bench)
 
fr subaddmul_impl (const fr &x, const fr &y, const fr &z)
 
void subaddmul_bench (State &state) noexcept
 
 BENCHMARK (subaddmul_bench)
 
void field_bench (State &state) noexcept
 
 BENCHMARK (field_bench)
 
void invert_bench (State &state) noexcept
 
 BENCHMARK (invert_bench)
 
void pow_bench (State &state) noexcept
 
 BENCHMARK (pow_bench)
 
void hash_bench (State &state) noexcept
 
 BENCHMARK (hash_bench)
 
 BENCHMARK_MAIN ()
 

Variables

constexpr size_t NUM_POINTS = 1 << 24
 
constexpr size_t NUM_INVERSIONS = 1 << 20
 
std::vector< bb::froldx
 
std::vector< bb::froldy
 
fr accx
 
fr accy
 
fr accz
 
const auto init
 

Function Documentation

◆ add_bench()

void add_bench ( State &  state)
noexcept

Definition at line 302 of file fr.bench.cpp.

◆ add_impl()

fr add_impl ( const fr x,
fr y 
)

Definition at line 293 of file fr.bench.cpp.

◆ addaddmul_bench()

void addaddmul_bench ( State &  state)
noexcept

Definition at line 352 of file fr.bench.cpp.

◆ addaddmul_impl()

fr addaddmul_impl ( const fr x,
const fr y,
const fr z 
)

Definition at line 341 of file fr.bench.cpp.

◆ BENCHMARK() [1/14]

BENCHMARK ( add_bench  )

◆ BENCHMARK() [2/14]

BENCHMARK ( addaddmul_bench  )

◆ BENCHMARK() [3/14]

BENCHMARK ( field_bench  )

◆ BENCHMARK() [4/14]

BENCHMARK ( hash_bench  )

◆ BENCHMARK() [5/14]

BENCHMARK ( invert_bench  )

◆ BENCHMARK() [6/14]

BENCHMARK ( mul_assign_bench  )

◆ BENCHMARK() [7/14]

BENCHMARK ( mul_bench  )

◆ BENCHMARK() [8/14]

BENCHMARK ( pow_bench  )

◆ BENCHMARK() [9/14]

BENCHMARK ( self_add_bench  )

◆ BENCHMARK() [10/14]

BENCHMARK ( sqr_assign_bench  )

◆ BENCHMARK() [11/14]

BENCHMARK ( sqr_bench  )

◆ BENCHMARK() [12/14]

BENCHMARK ( sub_bench  )

◆ BENCHMARK() [13/14]

BENCHMARK ( subaddmul_bench  )

◆ BENCHMARK() [14/14]

BENCHMARK ( unary_minus_bench  )

◆ BENCHMARK_MAIN()

BENCHMARK_MAIN ( )

◆ field_bench()

void field_bench ( State &  state)
noexcept

Definition at line 393 of file fr.bench.cpp.

◆ field_mixed_add()

void field_mixed_add ( const fr x1,
const fr y1,
const fr z1,
const fr x2,
const fr y2,
fr x3,
fr y3,
fr z3 
)

Definition at line 68 of file fr.bench.cpp.

◆ hash_bench()

void hash_bench ( State &  state)
noexcept

Definition at line 439 of file fr.bench.cpp.

◆ invert_bench()

void invert_bench ( State &  state)
noexcept

Definition at line 414 of file fr.bench.cpp.

◆ mul_assign_bench()

void mul_assign_bench ( State &  state)
noexcept

Definition at line 230 of file fr.bench.cpp.

◆ mul_assign_impl()

fr mul_assign_impl ( const fr x,
const fr y 
)

Definition at line 222 of file fr.bench.cpp.

◆ mul_bench()

void mul_bench ( State &  state)
noexcept

Definition at line 254 of file fr.bench.cpp.

◆ mul_impl()

fr mul_impl ( const fr x,
const fr y 
)

Definition at line 245 of file fr.bench.cpp.

◆ pow_bench()

void pow_bench ( State &  state)
noexcept

Definition at line 426 of file fr.bench.cpp.

◆ rdtsc()

uint64_t rdtsc ( )

Definition at line 111 of file fr.bench.cpp.

◆ self_add_bench()

void self_add_bench ( State &  state)
noexcept

Definition at line 278 of file fr.bench.cpp.

◆ self_add_impl()

fr self_add_impl ( const fr x,
fr y 
)

Definition at line 269 of file fr.bench.cpp.

◆ sqr_assign_bench()

void sqr_assign_bench ( State &  state)
noexcept

Definition at line 161 of file fr.bench.cpp.

◆ sqr_assign_impl()

fr sqr_assign_impl ( const fr x)

Definition at line 153 of file fr.bench.cpp.

◆ sqr_bench()

void sqr_bench ( State &  state)
noexcept

Definition at line 184 of file fr.bench.cpp.

◆ sqr_impl()

fr sqr_impl ( const fr x)

Definition at line 176 of file fr.bench.cpp.

◆ sub_bench()

void sub_bench ( State &  state)
noexcept

Definition at line 326 of file fr.bench.cpp.

◆ sub_impl()

fr sub_impl ( const fr x,
fr y 
)

Definition at line 317 of file fr.bench.cpp.

◆ subaddmul_bench()

void subaddmul_bench ( State &  state)
noexcept

Definition at line 378 of file fr.bench.cpp.

◆ subaddmul_impl()

fr subaddmul_impl ( const fr x,
const fr y,
const fr z 
)

Definition at line 367 of file fr.bench.cpp.

◆ unary_minus_bench()

void unary_minus_bench ( State &  state)
noexcept

Definition at line 207 of file fr.bench.cpp.

◆ unary_minus_impl()

fr unary_minus_impl ( const fr x)

Definition at line 199 of file fr.bench.cpp.

Variable Documentation

◆ accx

fr accx

Definition at line 132 of file fr.bench.cpp.

◆ accy

fr accy

Definition at line 133 of file fr.bench.cpp.

◆ accz

fr accz

Definition at line 134 of file fr.bench.cpp.

◆ init

const auto init
Initial value:
= []() {
fr seed_x = fr::random_element();
fr seed_y = fr::random_element();
fr seed_z = fr::random_element();
accx = seed_x;
accy = seed_y;
accz = seed_z;
for (size_t i = 0; i < NUM_POINTS; ++i) {
oldx.emplace_back(accx);
oldy.emplace_back(accy);
accx = accx * seed_x;
accy = accy * seed_y;
accz = accz * seed_z;
}
return 1;
}()
std::vector< bb::fr > oldx
Definition fr.bench.cpp:129
fr accy
Definition fr.bench.cpp:133
std::vector< bb::fr > oldy
Definition fr.bench.cpp:130
fr accz
Definition fr.bench.cpp:134
fr accx
Definition fr.bench.cpp:132
constexpr size_t NUM_POINTS
Definition fr.bench.cpp:127
static field random_element(numeric::RNG *engine=nullptr) noexcept

Definition at line 135 of file fr.bench.cpp.

◆ NUM_INVERSIONS

constexpr size_t NUM_INVERSIONS = 1 << 20
constexpr

Definition at line 128 of file fr.bench.cpp.

◆ NUM_POINTS

constexpr size_t NUM_POINTS = 1 << 24
constexpr

Definition at line 127 of file fr.bench.cpp.

◆ oldx

std::vector<bb::fr> oldx

Definition at line 129 of file fr.bench.cpp.

◆ oldy

std::vector<bb::fr> oldy

Definition at line 130 of file fr.bench.cpp.