jargon

Comparison

Component memoisationvsMemoisation

Component memoisation

you wrapped the component so it skips re-rendering when its props are shallowly the same.

Caching a component's rendered output and reusing it when its props have not changed by shallow comparison. It only helps when the props actually stay referentially stable, so a memoised component receiving an inline callback re-renders exactly as before while now also paying for the comparison. Applied without measuring, it usually adds cost and hides the real problem, which is a parent re-rendering more than it needs to.

Full entry →

Memoisation

you cache the return value of a pure function inside the process so calling it twice with the same arguments only computes once.

In-process caching keyed on a function's arguments, valid only where the function is genuinely pure. It is the cheapest caching there is, with no network hop and no serialisation. It is also invisible to your invalidation story: memoised values live until the process dies, which is why it belongs on computation, not on anything that reads state.

Full entry →

Related comparisons