diff --git a/performance/rust_app/Cargo.toml b/performance/rust_app/Cargo.toml index a05fad5..3617860 100644 --- a/performance/rust_app/Cargo.toml +++ b/performance/rust_app/Cargo.toml @@ -7,5 +7,5 @@ edition = "2024" rayon = "^1.11" i_key_sort = { path = "../../iKeySort", features = ["allow_multithreading"] } -rand = "0.9.2" +rand = "0.10.1" #i_key_sort = { path = "../../iKeySort", default-features = false } \ No newline at end of file diff --git a/performance/rust_app/src/exp/random.rs b/performance/rust_app/src/exp/random.rs index 4a5dbd8..c08cf6c 100644 --- a/performance/rust_app/src/exp/random.rs +++ b/performance/rust_app/src/exp/random.rs @@ -1,9 +1,9 @@ +use rand::RngExt; use crate::geom::id_segment::IdSegment; use crate::geom::index_segm::IndexSegment; use crate::geom::point::Point; use crate::geom::segm::Segment; use crate::solver::sort::SortSolution; -use rand::Rng; pub struct RandomTest { segments: Vec, diff --git a/performance/rust_app/src/solver/sort.rs b/performance/rust_app/src/solver/sort.rs index 1b8e21d..d2e5cf7 100644 --- a/performance/rust_app/src/solver/sort.rs +++ b/performance/rust_app/src/solver/sort.rs @@ -12,7 +12,7 @@ impl SortSolution { let n = Self::repeat_count(segments.len()); for _ in 0..n { - data.copy_from_slice(&segments); + data.copy_from_slice(segments); data.sort_unstable_by(|s0, s1| s0.cmp_by_start(s1)); } let duration = start.elapsed().as_secs_f64() / (n as f64); @@ -28,7 +28,7 @@ impl SortSolution { let n = Self::repeat_count(segments.len()); for _ in 0..n { - data.copy_from_slice(&segments); + data.copy_from_slice(segments); data.sort_by(|s0, s1| s0.cmp_by_start(s1)); } let duration = start.elapsed().as_secs_f64() / (n as f64); @@ -44,7 +44,7 @@ impl SortSolution { let n = Self::repeat_count(segments.len()); for _ in 0..n { - data.copy_from_slice(&segments); + data.copy_from_slice(segments); data.par_sort_unstable_by(|s0, s1| s0.cmp_by_start(s1)); } let duration = start.elapsed().as_secs_f64() / (n as f64);