-
Rust 1.66 nightly 기능❤️Box::assume_init 성능향상 기능코딩Coding/Rust❤️Optimization❤️ 2022. 9. 26. 20:28728x90
#![feature(new_uninit)] let big_box = Box::<[usize; 1024]>::new_uninit(); let mut array = [0; 1024]; for (i, place) in array.iter_mut().enumerate() { *place = i; } // The optimizer may be able to elide this copy, so previous code writes // to heap directly. let big_box = Box::write(big_box, array); for (i, x) in big_box.iter().enumerate() { assert_eq!(*x, i); }
Box in std::boxed - Rust
Consumes and leaks the Box, returning a mutable reference, &'a mut T. Note that the type T must outlive the chosen lifetime 'a. If the type has only static references, or none at all, then this may be chosen to be 'static. This function is mainly useful fo
doc.rust-lang.org
반응형'코딩Coding > Rust❤️Optimization❤️' 카테고리의 다른 글
Rust Before Main 최적화로 용량 줄이기?- Ryan Levick - Rust Linz, July 2022 (0) 2022.10.30 cargo bench보다 좋은거? gnuplot & plotters (0) 2022.10.20 러스트 수학 속도비교(glam, cgmath, nalgebra, euclid, vek,pathfinder, static-math, ultra.. (0) 2022.10.20 cargo size ❤️사용법_LLVM tools shipped with the Rust toolchain (0) 2022.09.29 How much expensive is Arc vs Rc? Arc의 Cost는 얼마나 많은 Cost를 지불하는지 에 대한 논문 (0) 2022.09.25 Rust❤️Impl trait initiative❤️eBook (0) 2022.09.23 Rust❤️<u32 as m::Foo>::foo(&x);__Trait function내가 원하는거 강제로 가지고 오기 (0) 2022.09.11 Make your Rust Binaries TINY! (0) 2022.09.06