Skip to content

Commit

Permalink
warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhooray committed Nov 30, 2024
1 parent 6789aaa commit 8eb11ae
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ fn bench_add_to_kdtree_with_1k_3d_points(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}
c.bench_function("bench_add_to_kdtree_with_1k_3d_points", |b| {
b.iter(|| kdtree.add(&point.0, point.1).unwrap());
Expand All @@ -35,8 +35,8 @@ fn bench_nearest_from_kdtree_with_1k_3d_points(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}
c.bench_function("bench_nearest_from_kdtree_with_1k_3d_points", |b| {
b.iter(|| kdtree.nearest(&point.0, 8, &squared_euclidean).unwrap());
Expand All @@ -51,10 +51,9 @@ fn bench_within_2k_data_01_radius(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}

c.bench_function("bench_within_2k_data_01_radius", |b| {
b.iter(|| kdtree.within(&point.0, 0.1, &squared_euclidean).unwrap());
});
Expand All @@ -68,8 +67,8 @@ fn bench_within_2k_data_02_radius(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}
c.bench_function("bench_within_2k_data_02_radius", |b| {
b.iter(|| kdtree.within(&point.0, 0.2, &squared_euclidean).unwrap());
Expand All @@ -84,8 +83,8 @@ fn bench_within_unsorted_2k_data_01_radius(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}
c.bench_function("bench_within_unsorted_2k_data_01_radius", |b| {
b.iter(|| kdtree.within_unsorted(&point.0, 0.1, &squared_euclidean).unwrap());
Expand All @@ -100,8 +99,8 @@ fn bench_within_unsorted_2k_data_02_radius(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}
c.bench_function("bench_within_unsorted_2k_data_02_radius", |b| {
b.iter(|| kdtree.within_unsorted(&point.0, 0.2, &squared_euclidean).unwrap());
Expand All @@ -116,8 +115,8 @@ fn bench_within_count_2k_data_01_radius(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}
c.bench_function("bench_within_count_2k_data_01_radius", |b| {
b.iter(|| kdtree.within_count(&point.0, 0.1, &squared_euclidean).unwrap());
Expand All @@ -132,8 +131,8 @@ fn bench_within_count_2k_data_02_radius(c: &mut Criterion) {
for _ in 0..len {
points.push(rand_data());
}
for i in 0..points.len() {
kdtree.add(&points[i].0, points[i].1).unwrap();
for point in points.iter() {
kdtree.add(&point.0, point.1).unwrap();
}
c.bench_function("bench_within_count_2k_data_02_radius", |b| {
b.iter(|| kdtree.within_count(&point.0, 0.2, &squared_euclidean).unwrap());
Expand Down

0 comments on commit 8eb11ae

Please sign in to comment.