News for hackers. Stuff that matters.
Re:Learn Rust the Dangerous Way by einpoklum on Monday October 21, 2024 @03:40AM (#41901657)
TL;DR: An introduction to Rust which starts with a Rust-unsafe C program, writing a Rust equivalent, then evolves it towards some of the higher-level abstractions in Rust.

(As opposed to the non-dangerous way which means writing safe code to begin with and mentioning unsafe as the exception)

Re:Learn Rust the Dangerous Way by Epholys on Monday October 21, 2024 @03:47AM (#41901687)
To complete the TL;DR : the safe Rust code is at 97% the speed of the C code, if keeping manual vectorization.
Re:Learn Rust the Dangerous Way by simon_void on Monday October 21, 2024 @04:06AM (#41901779)
To complete the completion of the TL;DR : the 95% safe Rust Code using auto vectorization is even slightly faster than the C code.
Re:Learn Rust the Dangerous Way by FFFXXX on Monday October 21, 2024 @05:27AM (#41902231)
The 95% safe Rust Code does not use any auto-vectorization (https://cliffle.com/p/dangerust/5/nbody-5.rs)

Only the 100% Rust-safe implementation uses auto-vectorization and is at 0.73% of the RUNTIME of the C code. (https://cliffle.com/p/dangerust/6/#performance-evaluation)

Re:Learn Rust the Dangerous Way by estebank on Monday October 21, 2024 @11:34AM (#41905286)
*73%
Re:Learn Rust the Dangerous Way by FFFXXX on Monday October 21, 2024 @05:24AM (#41902209)
No, the Rust code is at 97% of the RUNTIME of the C code (https://cliffle.com/p/dangerust/5/#evaluation) when keeping the manual vectorization.