Why is Java 4x faster than Rust for memoized fibonacci.
I wanted to test Java vs Rust speed, so I made two essentially equivalent Fibonacci programs. One in Rust and One in Java. I wanted to get the most speed out of rust and originally I was using a lazy static and a mutex but the locking was proving to be too slow so I switched to unsafe and static mut for the HashMap. But Java is still outperforming rust significantly, I am using --release mode aswell, why is this happening???
The code repo