You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
orph
changed the title
lcs on performed on small sequences, resulting in large diffs for larger sequences
lcs only performed on small sequences, resulting in large diffs for larger sequences
Jul 16, 2017
The rationale was that patches would be equivalent, and the actual implementation wanted to avoid high cpu usage for large sequences, so the tradeoffs was between diff size and computational complexity.
but you're right, it's pretty arbitrary :/
not sure if we should remove this behaviour and make it configurable somehow. Any suggestions?
for your case for eg., a higher number would be better?
the problem is that the patches are not equivalent - inserting an element causes many more operations with mapDiff. It's stepping through each pair following the inserted index, finding them different, and diffing all the individual fields. Versus with sequenceDiff it would be a single 'add' operation.
this line: https://github.com/intelie/immutable-js-diff/blob/master/src/diff.js#L67 performs a mapdiff if the input sequences are >99 long, which results in a large element-by-element diff. this is very unexpected and was hard to track down.
The text was updated successfully, but these errors were encountered: