코딩Coding/Rust❤️Optimization❤️
-
Rust 기본 PATH 및 Rust ❤️(rustup default nightly or stable)내맘대로 버젼 바꾸기❤️코딩Coding/Rust❤️Optimization❤️ 2022. 6. 17. 20:12
버젼 바꾸는 방법 // nightly 로 바꾸기 rustup default nightly // stable버젼으로 바꾸기 rustup default stable // 버젼 업데이트 시키기 rustup update https://www.oreilly.com/library/view/rust-programming-by/9781788390637/e07dc768-de29-482e-804b-0274b4bef418.xhtml Rust Programming By Example Installing Rust nightly With rustup, the tool we installed in Chapter 1, Basics of Rust, it is very easy to install nightly: rustup defau..
-
rust❤️] reduce vs fold의 차이(methods)코딩Coding/Rust❤️Optimization❤️ 2022. 6. 16. 17:59
https://docs.rs/rayon/1.5.3/rayon/iter/trait.ParallelIterator.html#method.reduce ParallelIterator in rayon::iter - Rust Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46. If you used sequential fold to add them (fold(0, |a,b| a+b), you would wind up first adding docs.rs Note: unlike a..
-
Rust❤️] map과 for_each의 차이점(for_each는 collect를 안 해도 된다 , 나같이 귀찮은거 싫어하는 사람에게 최고 구만ㅋ코딩Coding/Rust❤️Optimization❤️ 2022. 6. 16. 15:59
for_each는 Since Rust 1.21 버젼에서 나온듯 ❤️ 사랑 스러운 기능 https://stackoverflow.com/questions/32872013/does-rust-have-a-way-to-apply-a-function-method-to-each-element-in-an-array-or-v Does Rust have a way to apply a function/method to each element in an array or vector? Does the Rust language have a way to apply a function to each element in an array or vector? I know in Python there is the map() function..
-
Rust❤️rayon과 일반 기능{into_par_iter() vs into_iter()}❤️의 차이는 얼마나 날까?(concurrency의 대단함코딩Coding/Rust❤️Optimization❤️ 2022. 6. 14. 07:56
into_par_iter() vs into_iter()} 속도 ❤️의 차이 역시 병렬 실행이 3배 이상 빠르다 ㅋ 32분 15초 부터 https://youtu.be/9QyJ6b5I274 rayon과 일반 기능의 차이는 얼마나 날까? // rayon과 일반 기능의 차이는 얼마나 날까? use rayon::prelude::*; use std::time::Instant; fn main() { let time_1 = Instant::now(); let async_vec: Vec = (0..1_000_000).into_par_iter().collect(); let time_1_ela = time_1.elapsed(); let time_2 = Instant::now(); let sync_vec: Vec = (0....
-
Cargo benchmark활용법코딩Coding/Rust❤️Optimization❤️ 2022. 6. 14. 07:46
https://yiunsr.tistory.com/868 Rust 에서 benchmark 코드 작성하기 Rust 에서 nightly version 에서는 benchmark 를 기본으로 제공한다. 이게 언제 stable version 에 추가 될지는 모르겠지만 rust stable 버전에서는 다음 2가지 library 가 cargo bench 명령어를 지원한다. https:.. yiunsr.tistory.com 다른 방법 https://riptutorial.com/rust/example/11091/benchmark-tests Rust Tutorial => Benchmark tests Learn Rust - Benchmark tests riptutorial.com
-
Rust❤️]rayon 정의&Q&A 연습 및 관련 자료코딩Coding/Rust❤️Optimization❤️ 2022. 6. 14. 06:11
rayon github https://github.com/rayon-rs/rayon GitHub - rayon-rs/rayon: Rayon: A data parallelism library for Rust Rayon: A data parallelism library for Rust. Contribute to rayon-rs/rayon development by creating an account on GitHub. github.com rayon 연습 관련 Q&A https://github.com/rayon-rs/rayon/blob/master/FAQ.md GitHub - rayon-rs/rayon: Rayon: A data parallelism library for Rust Rayon: A data pa..
-
Rust❤️ VecDeque 벡터 맨 앞에 넣으려고 하면 VecDeque가 빠르다코딩Coding/Rust❤️Optimization❤️ 2022. 6. 14. 05:47
use std::collections::VecDeque; fn main() { let mut a = VecDeque::from([1, 2, 3]); a.push_back(6); let doubled: VecDeque = a.iter().map(|&x| x * 2).collect(); println!("{doubled:?}"); } 결과 cargo run Compiling rust_polyglot v0.1.0 (/Users/globalyoung/Documents/Project/Github/rust_project/rust_polyglot) Finished dev [unoptimized + debuginfo] target(s) in 0.10s Running `target/debug/rust_polyglot`..