title: Should function memoization always be preferred?
body: <p>Recently I came upon function memoization. </p>
  
  <p>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.</p>
  
  <p>My question is, should I always use memoization wherever possible or only for functions with heavy computing operations?</p>
  
  <p>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.).</p>
  
  <p>Example (random) function:</p>
  
  <pre><code>function isBigger(a: number, b: number) {
      return a &gt; b;
  }
  </code></pre>