Neil's News

What's the Diff?

19 March 2006

Part of my dissertation requires that I compute the difference between two texts using JavaScript. On the surface this seems like a fairly simple and generic problem.

Sure enough, an existing solution was available. Unfortunately it is buggy in its implementation, and flawed in its design. Another existing solution had no implementation bugs, but was based on the same flawed design. Yet another existing solution is so buggy it can't even detect equality (try "Hello Hello" on both sides).

Admittedly 'diff' is a tough nut to crack. It took quite a while to create my own version. Every speed-up I can think of has been added. Try it out:

Version 1:
Version 2:

< Previous | Next >

Legal yada yada: My views do not necessarily represent those of my employer or my goldfish.