Use maps instead of objects for tracking graph dependencies and dependents. These are much faster to iterate over according to this benchmark. Some local testing shows that these changes increase speed by up to 4x in some cases.
Also set the store._isSolo property instead of deriving it for a tiny speed gain. Also set the instance._isEvaluating property instead of deriving it from the evaluation stack for even more tiny speed gains.
Description
Use maps instead of objects for tracking graph dependencies and dependents. These are much faster to iterate over according to this benchmark. Some local testing shows that these changes increase speed by up to 4x in some cases.
Also set the
store._isSolo
property instead of deriving it for a tiny speed gain. Also set theinstance._isEvaluating
property instead of deriving it from the evaluation stack for even more tiny speed gains.Also improve bundle size a little bit.
Affects
atoms, core, immer, machines, react