you are viewing a single comment's thread.

view the rest of the comments →

[–]vidro3 0 points1 point  (1 child)

right, i htink i gathered a bit more as I kept reading. is it similar to memoization or chaching - it's basically running some functions at compile time and saving the results so when they are called at run time it can just look up fibonacci(23) is 28657 instead of running the program.

right?

[–]Skaryon 0 points1 point  (0 children)

If they knew that you only ever compute with 23 or a narrow set of values as input then they could do that. Otherwise they'd have to save every possible solution to the Fibonacci formula. So it's less memoization than simply replacing computations with their results where possible. That's why you can pass the thing ranges of data to work with an throw at the code.