Live data from Hacker News

Fibonacci(50) Performance: Java C C++ D Go Terra (Lua) Lua-JIT (Lua)

joshitech.blogspot.com

1–10 of 11 posts

Re: Fibonacci(50) Performance: Java C C++ D Go Terra (Lua) Lua-JIT (Lua)

#5
post #4

I wonder if the author validated the results returned by Java for Fibonacci 50. Performance can increase significantly when correctness is not an issue. :)

Yes, if you look at the https://github.com/rohitjoshi/lang-compare/blob/master/fibon..., it print fibonacci (50) = 12586269025

Re: Fibonacci(50) Performance: Java C C++ D Go Terra (Lua) Lua-JIT (Lua)

#6
post #3

You should try to implement the Fib with tail call and then test it. http://en.wikipedia.org/wiki/Tail_call

First he should implement it properly, remembering last two values at any time. His way is just plain outrageous.

Here the comparison is not about the algorithm, but language with similar recursion logic.

Re: Fibonacci(50) Performance: Java C C++ D Go Terra (Lua) Lua-JIT (Lua)

#9
post #6
post #3

Earlier quoted context omitted.

First he should implement it properly, remembering last two values at any time. His way is just plain outrageous.

Here the comparison is not about the algorithm, but language with similar recursion logic.

Then he should have used appropriate function to calculate, Ackermann for instance.
Post reply on HN