thomashoneyman/purescript-halogen-hooks

Optimization: only recheck `useTickEffect` memos when an effect modified state

JordanMartinez opened this issue · 1 comments

Due to #20, a useTickEffect's memos are always rechecked after the Initialize and Step phases in case a prior effect modified state. In such a situation, the useTickEffect's memos might now be outdated, so we need to recheck them and rerun the tick effect if they changed. Unfortunately, this step occurs even when we know that no state modifications have occurred. As a result, performance suffers somewhat due to the additional unnecessary render.

Thus, we should optimize the hooks implementation, so that during an Initialize or Step phase, we recheck the useTickEffect memos only if prior effect actually modified some state.

Closed by #28