-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as duplicate of#15414
Closed as duplicate of#15414
Copy link
Description
Describe the bug
This is more of an annoyance than a bug since the correct value ends up being returned, but unnecessary computation takes place (which in my use case is causing significant performance degradations).
The issue occurs when a unowned derived value depends on some state, then that state is updated, but the derived value evaluates to the same thing based on the new state. From this point on the derived value is always flagged as MAYBE_DIRTY
and so is re-computed each time it is read.
Reproduction
Logs
Step 0: first-time read of derived value
computing...
derived value: true
Step 1: update root value, should re-compute derived value
computing...
derived value: true
Step 2: read derived value again, should not re-compute derived value
computing...
derived value: true
System Info
System:
OS: macOS 15.4.1
CPU: (14) arm64 Apple M3 Max
Memory: 1.02 GB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
Browsers:
Chrome: 136.0.7103.114
Safari: 18.4
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels