-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add pow poly bench and link optimization issues (#4725)
Adds the pow poly bench. This PR was supposed to also optimize the pow poly computation, but I measured that it takes around 45ms of the whole 6-iter client IVC benchmark, so its not worth doing for now. Links a couple of optimization issues to the codebase: AztecProtocol/barretenberg#857 and AztecProtocol/barretenberg#864.
- Loading branch information
1 parent
50f89f1
commit faa9586
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
barretenberg/cpp/src/barretenberg/polynomials/pow.bench.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "barretenberg/polynomials/pow.hpp" | ||
#include "barretenberg/ecc/curves/bn254/fr.hpp" | ||
#include <benchmark/benchmark.h> | ||
|
||
using namespace benchmark; | ||
using namespace bb; | ||
|
||
namespace { | ||
|
||
void compute_pow_poly(benchmark::State& state) | ||
{ | ||
// just set up huge vector | ||
std::vector<bb::fr> betas{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | ||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 }; | ||
|
||
for (auto _ : state) { | ||
int64_t num_betas = state.range(0); | ||
std::vector<bb::fr> cur_betas(betas.begin(), betas.begin() + num_betas); | ||
PowPolynomial pow{ cur_betas }; | ||
pow.compute_values(); | ||
} | ||
} | ||
|
||
BENCHMARK(compute_pow_poly)->Unit(benchmark::kMillisecond)->Arg(20); | ||
|
||
} // namespace | ||
BENCHMARK_MAIN(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters