Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But Rust is designed to be blazing fast in many aspects, even if it uses a traditional malloc/free.

Most likely if you compare a Rust and Java program that both run a loop creating a million node linked list and then starting over, you'll see that the Java program is much faster. I'll actually try to do that and confirm, but I believe it should be the case.

Even if you were to allocate arrays (Vec) you may see the same.

But, of course, that is not a fair comparison. Rust gives you tools to avoid allocation in the first place. It also optimizes so many things that Java doesn't. Summing up all of the values in an ArrayList<Integer> in Java is going to be so much slower than doing the same in Rust it's not even funny. I'm not even sure that Java implements vectorization yet.

It would be very interesting to see what performance a Rust program would get with a good, concurrent parallel generational copying collector. Perhaps in a few years there will be some interest in that.



Intel has contributed vectorization support, all the way to AVX.


To OpenJDK’s JIT? I’ll have to try that sometime on ArrayList.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: