3 ms·
The Fibonacci comparison is a poor example of performance gains because Ruby is using large number data types to ensure the correct result. This is according t
by boyter 10y ago
The Fibonacci comparison is a poor example of performance gains because Ruby is using large number data types to ensure the correct result. This is according to the crystal language website itself.
"However, Crystal might give incorrect results, while Ruby makes sure to always give the correct result."
https://crystal-lang.org/2016/07/15/fibonacci-benchmark.html https://crystal-lang.org/2016/07/15/fibonacci-benchmark.html
- piyushpr134 10y agoThat is true. Ruby does a lot in the background and one of the reason why it is slow
- coltonv 10y agoi actually think it's a good example for just that reason. Ruby will automatically use those big number types on production applications as well as the fibonacci application, so it's demonstrating that difference and the effect that it has.