git/list[1] front-page[2] threads[3] people[4] search[5] about
 

suffix array/tree deltas (Was: The criss-cross merge case)

From
ZSZed A. Shaw <zedshaw@zedshaw.com>
Date
Apr 28, 2005, 03:41 UTC
Message-ID
<1114659700.5910.10.camel@thamachine>
In-Reply-To
<Pine.LNX.4.21.0504271854240.30848-100000@iabervon.org>
On Wed, 2005-04-27 at 19:32 -0400, Daniel Barkalow wrote:
> On Wed, 27 Apr 2005, Bram Cohen wrote:
> 
> My plan is to implement multi-file diff and merge with a suffix tree-based
> algorithm, and then revisit the history stuff once we have a merger that
> can do sensible things with this information.

Hey, that's neat. I've already implemented two versions of this very thing with FastCST. The original used suffix trees, but I found that there were plenty of pathological cases which chewed memory and processor. Most of these cases were large (>1MB) PDF files. Don't ask me why PDF drove suffix tree algorithms insane, but they just did.

I recently switched to a suffix array based algorithm which actually ends up being faster than the suffix tree alternative. I'm not using the most recent fastest algorithm and it still compares favorably with xdelta.

There's tons of weird things about doing a delta based on suffix arrays/trees, so feel free to pick my brain or the FastCST code if you attempt it. The difficult parts turn out to be making the suffix array and searching for the matching/non-matching regions. Once you do that the actual delta algorithm is a simple while loop that keeps doing the match/non-match detection.

Zed
Previous: David RoundyNext: Daniel Barkalow
Message 8 of 9 in “The criss-cross merge case”
  1. Bram CohenApr 27, 2005
  2. Daniel BarkalowApr 27, 2005
  3. Tupshin HarperApr 28, 2005
  4. Daniel BarkalowApr 28, 2005
  5. Benedikt SchmidtApr 28, 2005
  6. Daniel BarkalowApr 28, 2005
  7. David RoundyApr 28, 2005
  8. suffix array/tree deltas (Was: The criss-cross merge case)Zed A. Shaw, Apr 28, 2005
  9. Daniel BarkalowApr 28, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.