Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks: Add eval_poly #45

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;

use reed_solomon_simd::{
engine::{DefaultEngine, Engine, Naive, NoSimd, ShardsRefMut},
engine::{DefaultEngine, Engine, Naive, NoSimd, ShardsRefMut, GF_ORDER},
rate::{
HighRateDecoder, HighRateEncoder, LowRateDecoder, LowRateEncoder, RateDecoder, RateEncoder,
},
Expand Down Expand Up @@ -325,6 +325,19 @@ fn benchmarks_engine_one<E: Engine>(c: &mut Criterion, name: &str, engine: E) {
let mut group = c.benchmark_group(name);
let shard_len_64 = SHARD_BYTES / 64;

// EVAL_POLY

let mut rng = ChaCha8Rng::from_seed([0; 32]);
let mut data = [(); GF_ORDER].map(|_| rng.gen());

group.bench_function("eval_poly", |b| {
b.iter(|| E::eval_poly(black_box(&mut data), GF_ORDER))
});

group.bench_function("eval_poly truncated", |b| {
b.iter(|| E::eval_poly(black_box(&mut data), GF_ORDER / 8))
});

// XOR MUL

let mut x = &mut generate_shards_64(1, shard_len_64, 0)[0];
Expand Down