git-diff icon indicating copy to clipboard operation
git-diff copied to clipboard

Fake GitDiff Algorithm is super slow and can't disable the fallback to it.

Open roncRonc opened this issue 3 years ago • 2 comments

When comparing two very long strings, there is an automatic fallback to the fake gitDiff algorithm. My server stops responding to requests for ~60+ seconds. Please (if you can) add the ability to disable the automatic fallback. I mean, don't compute any diff and skip it in can the real gitDiff fails for some reason.

roncRonc avatar Aug 17 '20 11:08 roncRonc

I meant: [1] Add the ability to set by flag if I want this automatic fallback to happen or not. [2] Add the ability to limit the execution time of gitDiff operation. I mean, configure that after X milliseconds - reject.

Thank you!

roncRonc avatar Aug 17 '20 11:08 roncRonc

I don't have time to implement this but if you raise a PR and the unit tests continue to pass and coverage remains at 100% then I will merge it.

One question, are the necessary CLI commands available? The documentation states what CLI commands are required - I think the key one is "printf" off the top of my head - if the required CLI commands are available then the fallback should never happen

danday74 avatar Aug 19 '20 14:08 danday74