-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
computed properties are re-evaluating more often than expected #8540
Comments
|
note - reverted and not released due to regressions |
We also ran into a similar issue today. When can we expect the fix to be released for this? We can't use the v2.5.17-beta.0 because some things broke when we tried it so we reverted back to 2.5.16. This problem can cause some headaches, would be nice to have the fix released. |
Duplicate of #7767 |
Version
2.5.16
Reproduction link
https://jsfiddle.net/eywraw8t/193744/
Steps to reproduce
What is expected?
The value of C should only be re-computed when the value of B changes, independent of how often A is changing.
What is actually happening?
The value of C is re-computed whenever A changes. This results in many extra re-computations.
The docs say:
In this case, I thought there was a bug in my code because certain threshold-based computed properties were triggering re-computes far more often than expected, and some of these re-computes were fairly expensive.
Perhaps is expected behavior? However it was surprising to me, and negates a lot of the potential for cache-based optimization when leveraging computed props.
Compare to this implementation that uses watchers and extra data, but works as expected:
https://jsfiddle.net/eywraw8t/193746/
Here, C is only recomputed when B changes - not whenever A changes.
The text was updated successfully, but these errors were encountered: