Recently I came upon function memoization.
I have read, that it can be used to optimise calls to functions that do some heavy computing, by caching it results if function parameters didn't change.
My question is, should I always use memoization wherever possible or only for functions with heavy computing operations?
I.e, I could use it also for simple function returning a boolean comparison, but won't it make more load? (importing library, using decorators, wrapping with memoize function etc.).
Example (random) function:
function isBigger(a: number, b: number) {
return a > b;
}