You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, deallocation of Vecs is extremely slow, orders of magnitude slower than on Linux. I have some sample code below; after it prints "Initialized x...", it takes several seconds to deallocate x. If I use an array instead, it's nearly instantaneous on both platforms.
I'm using Windows 7, 64-bit, with 32-bit Rust.
Edit: If I pass the -O flag to rustc, it performs as expected. Still, I think this optimization is important enough that it might be worth enabling by default.
fn main() {
let x = box Vec::from_elem(50000000, 5.0f32);
// let x = box [5.0f32, ..50000000];
println!("Initialized x with length: {}", x.len());
}