Skip to content

Commit ba50e63

Browse files
committed
comments
1 parent fb80244 commit ba50e63

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

iris-mpc-cpu/benches/dot.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ fn generate_random_shared_irises(count: usize) -> Vec<Arc<GaloisRingSharedIris>>
176176
.collect()
177177
}
178178

179+
// Simulate dot-products as they occur in search_layer:
180+
// DEPTH times we open a new candidate node, each contributing NEW_NODES_PER_LEVEL new nodes
181+
// which are batched to compute distance to the source
182+
// Constants are chosen according to staging runs as of late August 2025.
183+
179184
pub fn search_layer_like_calls(c: &mut Criterion) {
180185
let mut g = c.benchmark_group("search_layer_like_calls");
181186
g.sample_size(10usize);
@@ -196,8 +201,7 @@ pub fn search_layer_like_calls(c: &mut Criterion) {
196201
|| {
197202
let mut rng = StdRng::seed_from_u64(42);
198203
let num_indices = DEPTH * NEW_NODES_PER_LEVEL;
199-
let indices = sample(&mut rng, all_irises.len(), num_indices).into_vec();
200-
indices
204+
sample(&mut rng, all_irises.len(), num_indices).into_vec()
201205
},
202206
|mut indices| {
203207
let initial_pairs: Vec<_> = initial_rhs_irises
@@ -231,9 +235,7 @@ pub fn search_layer_like_calls(c: &mut Criterion) {
231235
num_threads
232236
));
233237
g_parallel.sample_size(10);
234-
g_parallel.throughput(Throughput::Elements(
235-
(total_elements * num_threads as usize) as u64,
236-
));
238+
g_parallel.throughput(Throughput::Elements((total_elements * num_threads) as u64));
237239

238240
g_parallel.bench_function("identical order per thread", |b| {
239241
pool.install(|| {
@@ -264,7 +266,7 @@ pub fn search_layer_like_calls(c: &mut Criterion) {
264266
let mut indices = indices_for_thread.clone();
265267

266268
let initial_pairs: Vec<_> = initial_rhs_irises
267-
.into_iter()
269+
.iter()
268270
.map(|rhs| Some((source_iris.clone(), rhs.clone())))
269271
.collect();
270272
black_box(galois_ring_pairwise_distance(black_box(initial_pairs)));

0 commit comments

Comments
 (0)