Why Java program is faster than Rust in this comparision?

Because they not only allocate memories but also free them. Running GC over large amount of objects is an expensive task.

3 Likes