Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-compare-dev] released compare

#5238: Compare fails if takes more than 20 seconds

The file comparison algorithm used has O(nd) behavior, where n is the
number
of lines and d the number of differences. This becomes roughly O(n2) if
there
are lots of differences. This is not a problem as long as the number of
lines
is <2000. However if files with more than 15000 lines and (whitespace)
differences on every line are compared it becomes an issue.
I didn't try to fix the algorithm but I removed the 20 sec timeout and
added
a cancable progress dialog to the differencer.
This doesn't solve all problems because now the comparison of the 15000
line
files results in an OutOfMemoryException (after 5 minutes). However the
algorithm recoveres from the exception and the end user can try to run it
with the 'ignore whitespace option' turned on.




Back to the top