-
-
Notifications
You must be signed in to change notification settings - Fork 299
big data cause Page jammed #144
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
Comments
1.open node_modules/react-diff-viewer/lib/compute-lines.js |
I tried replace code, but can't find the getArr() function, where is it defined |
var getArr = (value, options) => {
} var spliceArray = function (arr, num) { |
Has your problem been solved? |
Will this be fixed in a future release? The above changes did work. |
Any update on getting this issue fixed in the repo? We are trying to diff large files but not files I would consider too big (ie ~2000 lines of code) and it is causing the browser to hang in most cases |
@praneshr I have created a PR to fix this issue #172 @LeePiaPia would be great to get a review as it was based on your provided code (with some cleanup) |
This code should not be used. It is faster, but it is incorrect. Because the new approach is "chunking" the diff processing into sets of 100 it gives incorrect results on inputs over 100 lines long. For example, you can use the following inputs to simulate a pair of input files 302 lines long where the only difference is that a single line has been removed from the new value.
When I try this in the original version of the code it works fine, and reports only the line containing "50" as removed and no other changes. When I try it with the suggested change above it correctly reports the line containing "50" as removed on the left, but then reports the lines containing "99", "149", "199", "249", and "299" as removed on the left and added on the right. This problem will become worse the larger the difference in line counts between the files. Once you get past 100 lines difference on a given side, every line will be reported as a difference even when all the lines exist with no changes elsewhere in each file. Note: I did this testing with the cleaned up version in the linked PR. |
use react-diff-viewer
data size :1m
The text was updated successfully, but these errors were encountered: