Hacker News new | ask | show | jobs
by apta 2222 days ago
I found Java's to be quicker than Rust:

Java:

    time java Test
    117777800
            0.60 real         0.52 user         0.12 sys
Rust:

    time ./test
    117777800
            1.94 real         1.89 user         0.00 sys
1 comments

What flags did you use with Rust?
Both `-O` and `-C opt-level=3`. I'm guessing this is one of those high throughput scenarios where having a GC is quicker because it's able to defer deallocation until the end of the program.
-O is opt level 2, incidentally.

Yeah, I think you’re right. Very interesting!