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

Allow html diffs to be interrupted / cancelled #36

Open
GoogleCodeExporter opened this issue Nov 6, 2015 · 3 comments
Open

Allow html diffs to be interrupted / cancelled #36

GoogleCodeExporter opened this issue Nov 6, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

DaisyDiff's html diff can be extremely resource hungry.  Eg our wiki recently 
encountered a page diff (admittedly a very large one) that caused the system to 
run out of memory.  Unit testing the difference at fault I gave it 900MB and it 
still OOMEd.  

There are numerous ways that the resource use could be limited.  Eg modifying 
the LCSSettings' limits, or implementing skipRangeComparison.  But I'd like to 
just make it cancellable externally (because it's easier).

The Eclipse RangeDifferencer at the heart of the HTMLDiffer can be passed an 
IProgressMonitor, whose isCancelled method is often checked.  When the 
IProgressMonitor is cancelled, that diffing operation terminates.

I'm working on a simple change to DaisyDiff to include a diff(IProgressMonitor 
progressMonitor, TextNodeComparator leftComparator, TextNodeComparator 
rightComparator) method that passes that progressMonitor through to the various 
calls to RangeDifference.

That's the most straightforward way to implement the functionality I need, but 
it's not necessarily the best.  Eg people might think we shouldn't leak the 
reliance on Eclipse classes to client code, which would be pretty reasonable.  
Also I haven't done anything about the rest of the IProgressMonitor interface 
at the moment, so it's a bit misleading to take one.

Original issue reported on code.google.com by don.jp.w...@gmail.com on 17 May 2011 at 12:04

@GoogleCodeExporter
Copy link
Author

Perhaps it would be better to find out if there are any memory leaks and fix 
them first?

I am not sure if DaisyDiff was designed in order to run with gigantic files. 
See also issue 21 and issue 23

Original comment by kkape...@gmail.com on 19 May 2011 at 8:36

@GoogleCodeExporter
Copy link
Author

There's no memory leaked beyond the end of the operation.   It's just that as 
daisydiff/rangedifferencer go through their machinations they slowly create a 
giant set of result definitions.  This may be the result of a bug that occurs 
for my specific data, but I don't really think so. Doubtless there are 
improvements to be made to daisy diff's memory usage.  But it may never be 
achievable to make it handle absolutely any data in limited time and memory.

However, as long as a running diff can be cancelled externally, mitigation for 
impossible diffs is feasible.

I don't consider this issue to be a defect report but an enhancement request 
(but I can't set that).

Think of it as a solution to 
http://code.google.com/p/daisydiff/issues/detail?id=21#c5 that is based on the 
observation that daisydiff takes considerable time to consume memory.

Original comment by don.jp.w...@gmail.com on 20 May 2011 at 12:29

@GoogleCodeExporter
Copy link
Author

Original comment by kkape...@gmail.com on 20 May 2011 at 7:33

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

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