Compared with data from http://www.bigprimes.net/archive/fibonacci/
$ go build && time ./fibonacci
The 1:th fibonacci number is 0
The 2:th fibonacci number is 1
The 3:th fibonacci number is 1
The 4:th fibonacci number is 2
The 5:th fibonacci number is 3
The 6:th fibonacci number is 5
The 7:th fibonacci number is 8
The 8:th fibonacci number is 13
The 9:th fibonacci number is 21
The 10:th fibonacci number is 34
The 1001:th fibonacci number is 43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875
The 500000:th fibonacci number has 104494 digits
real 0m6.729s
user 0m6.700s
sys 0m0.422s
The calculation of the 500000:th fibonacci is a bit time consuming :-)
I was checking out the Rust version of the above code, BigInt crate to be specific and it blew my mind! 🤯
Rust program was able to utilize 100% of CPU.
Memory Usage: 500 Kb - 3 Mb (While outputting the whole Big Int String).
I installed the Golang compiler and did a benchmark on my system.
I lost patience after 5+ minutes (351 Seconds) for the number 5 million, In my first try 😅, so had to run it again to do justice to Golang.
Memory remained around ~10 - 40mb.
It was unable to use 100% of processor.
P.S. I know micro benchmarks don't make sense in real world, I was just curious. I am writing my observation down here, in case someone else is curious in the future, or I myself want to check these out.
My system specs: