Equality checks and large data sets #274
Replies: 3 comments
-
I think it is better than making API complex with more options.
It is also nice idea, but we need research of API and how to implement it with less code. |
Beta Was this translation helpful? Give feedback.
-
Tried to rework |
Beta Was this translation helpful? Give feedback.
-
After some more thinking, I have decided that |
Beta Was this translation helpful? Give feedback.
-
I am a working with a large dynamic deep nested map of data. I have read in some of the tickets that there is no batch update for maps and deep maps, because the expectation is that the UI framework should take care of throttling rerenders. That however isn't very efficient - I have thousands of updates within dozens of milliseconds and they freeze the app because of all the changes that happen to the map. Each change causes a chain reaction of notifying listeners, which then recompute and notify their listeners, and so it goes. For now, I have switched back to atom, replacing the entire state at once, which solves the freezing problem, but I suspect there is still too much unnecessary recomputation going on.
If we look at the atom setter, we see this equality check:
Working with atoms, I can do some other equality checks from the outside. In case of computed values, however, it seems that there is no way to guarantee that values are identical even though values are equal.
I am wondering what your suggestion would be. I see 2 possible solutions:
Beta Was this translation helpful? Give feedback.
All reactions