Near Endless Loop calling execEditLength
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- tooling
Research direction
Start by reproducing the slow createPatch case described in the issue, then inspect src/diff/base.js around diagonalPath, editLength, and maxEditLength. Compare the behavior with the linked Mocha call site and establish a bounded runtime or earlier failure for the reported input without changing the intended diff result.
Written by the indexing model from the issue text.
Description
I was noticing an endless hang when using mocha and filed this issue and managed to run down the problem in mocha to the use of jsdiff. Their use of createPatch here seems to cause an almost endless loop.
While it would eventually fail once maxEditLength is exceeded this would take ages as diagonalPath grows at the rate of editLength here.
The test has a maxEditLength of 57579 and even after about ~10 minutes of processing editLength is only 4542. Sadly it gets exponential worse.
- Dominant language
- JavaScript
- Stars
- 9.2k
- Forks
- 555
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kpdecker/jsdiff
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
kpdecker/jsdiff#703 · 1 reaction ·
Maintainers usually reply within 1 day
-
Applying a patch with a fuzzFactor can be very very slowPossibly taken @json-open-source claimed this 39 days ago. Openperformance
Difficulty 4/5 3-5 days Newbie friendliness 48/100
kpdecker/jsdiff#692 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
kpdecker/jsdiff#684 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
kpdecker/jsdiff#629 · 7 comments ·
Maintainers usually reply within 1 day
Similar issues
-
channels:edit check:passed
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
lidofinance/docs#1033 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day