On Tue, 11 Dec 2007, Davide Libenzi wrote: > > I didn't follow the thread, but I can guess from the subject that this is > about memory, isn't it? No, it started out that way, but now it's about performance. > Libxdiff already has a xdl_trim_ends() that strips all the common > beginning and ending records, but at that point files are already loaded. That's not the problem. The problem with xdl_trim_ends() is that it happens *after* you have done all the hashing, so as an optimization it's fairly useless, because it still leaves the real cost (the per-line hashing) on the table. So doing the trimming of the ends before you do even that, allows you to just do the trivial "let's see if the ends are identical" with a plain memcmp, which is much faster. Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html