Derive function for XYFrame attempted to check if any input data has changed before recalculating the frame state. The way how basicDataChangeCheck() is implemented, it implies that even if the data hasn't change by reference, it may have changes in the internal value it holds. Basically, we check for mutable changes in data arrays (e.g. use of [].splice()). The way how the further mutable changes check works is N^2 checks for N being the size of array. It appears that the part works very slow in Safari, up to the point where redundant re-render is cheaper than the memoization check preventing it.
Given the nature of Semiotic being a React library, it is hard to come up with scenario where a re-render of XYFrame can be triggered after mutable changes of data. It has to be very intentional and hacky thing. In this PR I suggest we avoid complex changes checks and embrace the requirement to use immutable data.
@emeeks, is there any other places like this that we can improve by dropping exhaustive changes checking?
I ended up removing whole src/components/processing/diffing.ts file since no other functions had any use.
Derive function for XYFrame attempted to check if any input data has changed before recalculating the frame state. The way how
basicDataChangeCheck()
is implemented, it implies that even if the data hasn't change by reference, it may have changes in the internal value it holds. Basically, we check for mutable changes in data arrays (e.g. use of[].splice()
). The way how the further mutable changes check works is N^2 checks for N being the size of array. It appears that the part works very slow in Safari, up to the point where redundant re-render is cheaper than the memoization check preventing it.Given the nature of Semiotic being a React library, it is hard to come up with scenario where a re-render of XYFrame can be triggered after mutable changes of data. It has to be very intentional and hacky thing. In this PR I suggest we avoid complex changes checks and embrace the requirement to use immutable data.
@emeeks, is there any other places like this that we can improve by dropping exhaustive changes checking?
I ended up removing whole
src/components/processing/diffing.ts
file since no other functions had any use.