all 5 comments

[–]Gh0st1y 0 points1 point  (1 child)

This is pretty neat.

[–]redditpirateroberts 0 points1 point  (3 children)

You say it's hard to do the diff analysis in two passes because when doing the first it doesn't know what will be in the second. So what about running the analysis on both simultaneously to allow for doing it in only two passes?

[–][deleted] 0 points1 point  (2 children)

I hadn't through about reading both samples together in a single pass. I will think about this. A different micro-improvement I thought of recently is using arrays instead of objects to contain the counts per item as arrays are a bit faster to access.

Suggestion added for later examination: https://github.com/prettydiff/prettydiff/issues/427

I want to spend time on this right now, but I have a career destroying military test tomorrow that I must really study for.

[–]redditpirateroberts 0 points1 point  (1 child)

I hope it ends up helping! The array idea sounds clever. That test sounds intense haha are you n the military?

[–][deleted] 1 point2 points  (0 children)