I was testing some code in different programming languages, just seeing which is more readable, with less LOC and maybe faster. The languages are C++, Rust and Go.
I think I made some mistake (I’m learning rust, so the test itself is not to consider which language is better, I’m just doing some simple comparisions), because even with inline optimization (In fact, the performance got worst with it) the Rust version is much slower than C++'s.
The test is the “fibonacci result” of 45. The results are:
C++ : 3.685s
So, am I doing it “wrong”? (maybe there’s some idiomatic way to code this, I missed some important optimization or maybe there’s no way it can be faster at all…?).
Thanks in advance.