Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line-by-line mode sub-optimal. #38

Closed
GoogleCodeExporter opened this issue Aug 1, 2015 · 5 comments
Closed

Line-by-line mode sub-optimal. #38

GoogleCodeExporter opened this issue Aug 1, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

Diff sometimes doesn't find what should be trivial differences.


What steps will reproduce the problem?
1. Use the website to compare the two attached texts 
2. Compare v1text to v2text
3. Compare v2text to v1text

What is the expected output? What do you see instead?

The only difference between these two texts is the years.  2009 vs 2010

In one case this is computed correctly.
In the other case, you see one large block of text inserted, and
another large block of text deleted.  (timeout was set to 0)

What version of the product are you using? On what operating system?

http://neil.fraser.name/software/diff_match_patch/svn/trunk/demo/demo_diff.html

Please provide any additional information below.

Shouldn't the output be symmetric?

Original issue reported on code.google.com by garyor...@gmail.com on 19 Jan 2011 at 9:57

Attachments:

@GoogleCodeExporter
Copy link
Author

Confirmed.  Investigation shows that this is the result of the line-by-line 
speedup.  There exist cases such as this one where this speedup is sub-optimal. 
 Your example is the worst I've ever seen.  I need to take a closer look at 
whether this speedup is worth it.

If you want a truly accurate diff, use diff_main(text1, text2, false).  The 
third argument (which defaults to true) controls the line-by-line speedup.

Original comment by neil.fra...@gmail.com on 20 Jan 2011 at 1:43

  • Changed title: Line-by-line mode sub-optimal.
  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Issue 46 has been merged into this issue.

Original comment by neil.fra...@gmail.com on 13 May 2011 at 11:20

@GoogleCodeExporter
Copy link
Author

The root cause has been unexpectedly tracked down to diff_cleanupSemantic and a 
changelist has been submitted for review.  Should take a week before it is 
published.

Original comment by neil.fra...@gmail.com on 14 May 2011 at 3:51

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Sorry for the delay.  I've just pushed a new version which fixes this class of 
issues.  As always, the upgrade is a drop-in replacement.

Original comment by neil.fra...@gmail.com on 3 Jun 2011 at 5:55

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant