3 ms·
It's quite a naive implementation, nice to blog about but from practical point of view it's just noise.
by babo 18y ago
It's quite a naive implementation, nice to blog about but from practical point of view it's just noise.
- KirinDave 18y agoSure, but the point is to say, "This small body of code gives you a naive but fully functional mapreduce." You have a lot of time to give it all the trimmings while other possible implementations just get off the ground and get tested.
- babo 18y agoThe first 40 Fibonacci numbers are calculated on my laptop under 5 milliseconds using the Erlang code below, i.e. more then 2000 times faster then his measured 10.xxx second on an 8 core server. Erlang has an edge for sure, but you need to implement that few lines in a proper and efficient way to prove it and a meaningful test is a must. ffib(0) -> [0]; ffib(1) -> [0, 1]; ffib(N) when N > 0 -> ffib([1, 1, 0], 2, N). ffib(R, N, N) -> lists:reverse(R); ffib([H1, H2 | _] = Prev, C, N) -> ffib([H1+H2 | Prev], C+1, N).