We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current benchmark for calculating the 80th Fibonacci number 1000 times:
n.fib = n.fib(0, n) 0.fib(a, _) = a n.fib(a, b) = (n-1).fib(b, a+b) 0.times(_, r) = r x.times(f, _) = (x-1).times(f, f(1)) x.times(f) = x.times(f, 0) 999.times(|_| 80.fib) out(80.fib)
1873338267877414800 real 0m3.147s user 0m3.124s sys 0m0.015s
For comparison, Ruby is:
real 0m0.809s user 0m0.453s sys 0m0.294s
And compiled Swift is:
real 0m0.016s user 0m0.007s sys 0m0.005s
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Current benchmark for calculating the 80th Fibonacci number 1000 times:
For comparison, Ruby is:
And compiled Swift is:
The text was updated successfully, but these errors were encountered: