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 308 of file fr.bench.cpp.

◆ add_impl()

fr add_impl ( const fr x,
fr y 
)

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

◆ addaddmul_bench()

void addaddmul_bench ( State &  state)
noexcept

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

◆ addaddmul_impl()

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

Definition at line 347 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 399 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 74 of file fr.bench.cpp.

◆ hash_bench()

void hash_bench ( State &  state)
noexcept

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

◆ invert_bench()

void invert_bench ( State &  state)
noexcept

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

◆ mul_assign_bench()

void mul_assign_bench ( State &  state)
noexcept

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

◆ mul_assign_impl()

fr mul_assign_impl ( const fr x,
const fr y 
)

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

◆ mul_bench()

void mul_bench ( State &  state)
noexcept

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

◆ mul_impl()

fr mul_impl ( const fr x,
const fr y 
)

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

◆ pow_bench()

void pow_bench ( State &  state)
noexcept

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

◆ rdtsc()

uint64_t rdtsc ( )

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

◆ self_add_bench()

void self_add_bench ( State &  state)
noexcept

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

◆ self_add_impl()

fr self_add_impl ( const fr x,
fr y 
)

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

◆ sqr_assign_bench()

void sqr_assign_bench ( State &  state)
noexcept

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

◆ sqr_assign_impl()

fr sqr_assign_impl ( const fr x)

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

◆ sqr_bench()

void sqr_bench ( State &  state)
noexcept

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

◆ sqr_impl()

fr sqr_impl ( const fr x)

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

◆ sub_bench()

void sub_bench ( State &  state)
noexcept

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

◆ sub_impl()

fr sub_impl ( const fr x,
fr y 
)

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

◆ subaddmul_bench()

void subaddmul_bench ( State &  state)
noexcept

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

◆ subaddmul_impl()

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

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

◆ unary_minus_bench()

void unary_minus_bench ( State &  state)
noexcept

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

◆ unary_minus_impl()

fr unary_minus_impl ( const fr x)

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

Variable Documentation

◆ accx

fr accx

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

◆ accy

fr accy

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

◆ accz

fr accz

Definition at line 140 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:135
fr accy
Definition fr.bench.cpp:139
std::vector< bb::fr > oldy
Definition fr.bench.cpp:136
fr accz
Definition fr.bench.cpp:140
fr accx
Definition fr.bench.cpp:138
constexpr size_t NUM_POINTS
Definition fr.bench.cpp:133
static field random_element(numeric::RNG *engine=nullptr) noexcept

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

◆ NUM_INVERSIONS

constexpr size_t NUM_INVERSIONS = 1 << 20
constexpr

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

◆ NUM_POINTS

constexpr size_t NUM_POINTS = 1 << 24
constexpr

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

◆ oldx

std::vector<bb::fr> oldx

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

◆ oldy

std::vector<bb::fr> oldy

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