-
Notifications
You must be signed in to change notification settings - Fork 45
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
memory leaks #94
Comments
Actually, I've tried it with > 100kb files and it works. But I suppose that your problem concerns the recursive algorithm which In the version It would be great if you give me an example of a file which now fails. |
Or you can even help me and test the prototype of version Checkout the branch |
I tried to install version 1.0.0 but it always says its running 0.5 when you check with -v (version) Also it runs long and then dies. What is the procedure to install version 1.0.0. correctly? I downloaded branch support/1.0.0 and then went to that folder and executed "npm install ." I can send you files, can you give me your email, or something to comunicate? Best, |
Yep, version You should clone the branch npm install
bin/html-differ --help my email: |
Hmm strange, it still doesnt work. And you email doesnt work either, it says no such user. best, |
Send here. I'll think about this problem. |
I sended. I think it gots problems with bigger htmls because like you said recursive algorithm. But with 1.0.0 it doesnt seem to be any diffrent. Maybe we could split html to few slices, and process them separatly. |
Thank you! I'll figure it out as soon as possible! |
OK, thanks. If I can help in anyway, please tell me. Best regards, |
I've understood why this happens. It is so many diffs in the given I've opened an issue in jsdiff == > issue34 P.S. If you run |
Hmmm, The problem is that a lot of smaller files (>40+50 kb) also failes. If jsdiff adds maximum loop, we didnt solve the problem, because we dont show all diffs. The files I sended are real life webpages, so they should make problems. Maybe the solution would be to split html to chunks and parallel process this chunks. Just an idea. Im more into php, so dont have very good knowledge about node.js. Best regards, |
The problem is not in sizes of How can you split the HTML? What criteria to use? If you split it , you can break it and the comparison will be not fair. The idea of the differ was to compare not absolutely different Is it necessary to compare |
As the variant. You see not all diffs, fix them or do something else what you want and run |
I've found the solution! In current implementation of Solution: This mode of Does this variant suit you? |
Hey, Great 👍 Is the result still the same if you compare line by line instead of word by word? Because of classes, and other things you meantioned in README? How can I apply this patch, what file should I change to enable this, so I can test some more files? :) |
I am going to do this in version |
If I will compare texts by lines, the option For example, if you set the option which compares files by lines, <span>
</span> turns to <span>
</span> Does this variant suit you? |
Yep, it should do it, as long as both are changed same way. Commit changes asap, and I will test with few diffrent htmls. I had another idea, what if we first check line by line, and then if lines are the same go on, if not we also check word by word that line. Maybe then you get best from both worlds - speed and great diff tool. Just an idea, dont know if its possible to make it. |
Hmmm... Not bad, not bad... I'll think about it and fix it ASAP! |
Great, Thanks for fast replay. I will prepare diffrent (sizes, tags, etc...) Best regards, |
I will do the implementation of a new option (my solution), it should solve your problem too. And after that in minor version I 'll think about the enhancement that you have proposed, because I also need ASAP something working ) and after release of Created an issue concerning your idea == > change the comparison algorithm |
Yeah, I agree with you 👍 👍 |
I can not understand, why do you need differ in tasks when you can find diffs without any tools? Also see the comments about you ideas concerning the new algoritm of comparison ==> #95 |
Because I really like your tool, and it was working great. I dont understand, why you dont want it to work on bigger files too. Can you just add option to choose between lines, words as option? I tried to do it myself but could find what function is calling diff.js. Thanks, |
It is not a problem to compare texts by lines! I've implemented this option, but it will not help you. Because as I've already said you that even in this mode! there are so many diffs that When we compare by words, we receive more than 50000 diffs - it is too big for |
Hmm, I see. In my tests no problem to 2000 - 3000, then it stops. Could we optimise something else? |
It seems No! It is absolutely the task of |
when i try it with > 100kb files, it almost always gets to this message:
it also runs long time, before showing this error (few minutes). Would it be possible to process diff with multiple child processes. Every child would process part of html, use less memory and we would utilize multiple CPUs (since all servers nowadays have few processors).
Or some other memory handling, to prevent leaks? Otherwise, great code, very usefull!
The text was updated successfully, but these errors were encountered: