Comments (5)
This is an issue in python's difflib
. You can get diff.py
from https://docs.python.org/3/library/difflib.html and you'll see python3 diff.py file1.txt file2.txt
hangs (or just is very slow).
I think this is "expected behavior" for difflib
: "The basic Ratcliff-Obershelp algorithm is cubic time in the worst case and quadratic time in the expected case. SequenceMatcher is quadratic time for the worst case and has expected-case behavior dependent in a complicated way on how many elements the sequences have in common; best case time is linear." --https://docs.python.org/3.5/library/difflib.html#difflib.SequenceMatcher
You could consider filing a bug on difflib
, or contributing something there that improves worst-case behavior?
from icdiff.
Is adding an option to use cdifflib something you'd consider?
https://stackoverflow.com/a/66694154/8742968
https://pypi.org/project/cdifflib/
from icdiff.
@mattrussell2 I think that wouldn't solve the problem? Skimming that package. It looks like a re-implementation in C, but still the same algorithm?
(It's also missing some parts of difflib that icdiff depends on, but that might not be insurmountable?)
from icdiff.
Fair enough. Yeah 4x is certainly not going to fix polynomial-time issues.
If anyone's interested, the relevant issue re: difflib is here: python/cpython#51180
from icdiff.
What about using google's diff-match-patch?
https://github.com/google/diff-match-patch
This also takes an optional timeout parameter.
From my very quick reading of the source code here, seems like this library should be interoperable....but I'll dig into it a bit more.
from icdiff.
Related Issues (20)
- update icdiff on pypi.org to latest version HOT 2
- ChangeLog does not mention versions newer than 1.9.4 HOT 1
- BUG: Filenames show as mismatch when using exclusions
- Bug report: configuration for `git icdiff` did not work HOT 2
- installing the latest release-2.0.0 requires different command than install instructions HOT 2
- icdiff doesn't work on windows HOT 2
- Add support to specify colors using RGB ? HOT 1
- Add Support for custom patch hunk headers (with some builtins) HOT 1
- It seems have some problem about utf-8 HOT 1
- git icdiff shows old filname for renamed files HOT 2
- Multi-version of the Python HOT 1
- Exit code 1 using process substitutions HOT 4
- Pip install with `--platform` showing ERROR HOT 2
- [issue] linux more shows empty line. ex) icdiff -N fileA fileB | more -60 HOT 1
- Config file HOT 1
- Feature Request: Add an option to output directories before the files (recursively) HOT 1
- Not clear how to install icdiff HOT 2
- Publish wheels for icdiff HOT 3
- Questions about Copilot + Open Source Software Hierarchy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icdiff.