2 ms·
Memoization works amazingly and can be very easy to implement, but it's not always that applicable. In my experience, I just don't hit that many pure functions
by Klathmon 10y ago
Memoization works amazingly and can be very easy to implement, but it's not always that applicable.
In my experience, I just don't hit that many pure functions that don't do things like touch the database (which can change out from under the function), or are called enough with the same arguments that memoization is actually worth it.
But when it does work, it's like magic. I do a lot of work in javascript now, and it's great being able to wrap a function in a single line `memoize` function and instantly improve performance.