I try to write Fibonacci numbers by Crystal that code is same Ruby.
That is different from only finename extension.
def fib(n) return n if n <= 1 fib(n - 1) + fib(n - 2) end puts fib(40)
The results are as follows.
(ruby: 2.2.2, crystal: 0.9.1)
$ time ruby fib.rb 102334155 real 0m17.136s user 0m17.050s sys 0m0.063s
$ time crystal fib.cr 102334155 real 0m1.960s user 0m0.990s sys 0m0.400s
$ crystal build fib.cr --release $ time ./fib 102334155 real 0m0.646s user 0m0.639s sys 0m0.004s
$ time go run fib.go 102334155 real 0m1.386s user 0m1.216s sys 0m0.116s
$ time ./fib 102334155 real 0m0.765s user 0m0.755s sys 0m0.006s
There was no big difference when compared.