We tried to use the AwesomeTableAnimationCalculator in production for our app, but it did not work out due to performance issues.
We observed the significant CPU usage hit on diff calculation. The diff calculation involves plenty of Array.indexOf() calls, and those cost ~O(n) where n is the size of the array.
I've tried to port the framework to use NSOrderedSet where the lookup is O(1), but did not succeed because ordered set is looking objects up not by hash but by memory address, and as log as the data source objects are copied, the lookup can not be successful.
Possible option could be to use one of implementations of ordered set that are done in swift.
PS: If needed I can provide the port implementation that I've done to try NSOrderedSets
We tried to use the
AwesomeTableAnimationCalculatorin production for our app, but it did not work out due to performance issues.We observed the significant CPU usage hit on diff calculation. The diff calculation involves plenty of
Array.indexOf()calls, and those cost ~O(n)wherenis the size of the array.I've tried to port the framework to use
NSOrderedSetwhere the lookup isO(1), but did not succeed because ordered set is looking objects up not by hash but by memory address, and as log as the data source objects are copied, the lookup can not be successful.Possible option could be to use one of implementations of ordered set that are done in swift.
PS: If needed I can provide the port implementation that I've done to try
NSOrderedSets