Skip to content

Commit d2d1d72

Browse files
committed
add "Optimal time we can hope for" in logup_star benchmark
1 parent a99d456 commit d2d1d72

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

crates/lookup/src/logup_star.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ pub fn compute_pushforward<F: PrimeField64, EF: ExtensionField<EF>>(
256256

257257
#[cfg(test)]
258258
mod tests {
259+
use std::time::Instant;
260+
259261
use super::*;
260262
use p3_field::PrimeCharacteristicRing;
261263
use p3_koala_bear::{KoalaBear, QuinticExtensionFieldKB};
@@ -340,5 +342,22 @@ mod tests {
340342
for eval in &statements.on_pushforward {
341343
assert_eq!(pushforward.evaluate(&eval.point), eval.value);
342344
}
345+
346+
{
347+
let n_muls = 16;
348+
let slice = (0..(table_length + indexes_len) / packing_width::<EF>())
349+
.map(|_| rng.random())
350+
.collect::<Vec<EFPacking<EF>>>();
351+
let time = Instant::now();
352+
let sum = slice
353+
.par_iter()
354+
.map(|x| (0..n_muls).map(|_| *x).product::<EFPacking<EF>>())
355+
.sum::<EFPacking<EF>>();
356+
assert!(sum != EFPacking::<EF>::ZERO);
357+
println!(
358+
"Optimal time we can hope for: {} ms",
359+
time.elapsed().as_millis()
360+
);
361+
}
343362
}
344363
}

0 commit comments

Comments
 (0)