You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reflex currently uses a universal fast-deep-equal check inside every reaction to determine whether to update and notify downstream dependents. While this ensures correctness, it may cause performance issues depending on the app's data structure and computational characteristics.
This issue proposes making the reaction update strategy configurable to better support different performance profiles.
Summary
Reflex currently uses a universal
fast-deep-equalcheck inside every reaction to determine whether to update and notify downstream dependents. While this ensures correctness, it may cause performance issues depending on the app's data structure and computational characteristics.This issue proposes making the reaction update strategy configurable to better support different performance profiles.
Current Behavior
draftDbin Reflex #5fast-deep-equalto check for changes.This means:
Problems
deepnonedeepEqualnone+ manual dirtycustom hasChanged()Proposal
Introduce configurable reaction update strategies, both per reaction and globally:
Strategy options:
'deep'fast-deep-equal'shallow'Object.is, per-field)'none'hasChanged()Why This Matters
Reflex's current design favors correctness by always checking values via
deepEqual. But this introduces runtime cost in many scenarios.Adding configurable reaction update strategies gives developers:
Next Steps
✳️ Open for discussion and feedback.