Ad
  • Custom User Avatar

    No this is still pointless. If you have to optimize something for fib numbers, that's absolutely not what you have to do. What you should do to get better performances is first to change the complexity of the algo. Meaning, garbage the whole code and use the fastest known.

    "Do never mocrooptimize the code with a bad time complexity".

    And second point, either we didn't understood each others, or your point isn't logical: you're talking about optimizing the very first step. 1 over, let's say, 1000. The thing is, the time of computation of fib numbers grows with their size. So let's imagine that the very first step is 1000 time faster than the last one (and I'd bet on a really low estimation), so you're optimizing, by 10-20% something that represent less than 1/1 000 000 of the computation time (and here again, this is a very low estimation, since I didn't take into account the time of the terms in between. So it's certainly more something like 1/10e9 that we should have in mind). Still worthless.

  • Custom User Avatar

    Seriously? :o

    This is non sense! You're talking about a mircooptimization that will give you 10-20% better speed on the first single operation of... how many others? hundreds? thausends?? Because even if it's not the case in this katas, that algo is used to produce rather big fib numbers (even if there is another algo that is faster). So the optimization you're suggesting is just totally pointless...

  • Custom User Avatar

    Hey, would you mind posting your code formatted in Markdown or at least post the error (expected and actual), so I can see what the problem is.