Careful. The real cost of diffing, is not the O(1) pass of the prepare
phase. It's the potentially O(N*M) worst case of the cross-record compare.
So that optimization is far from useless. That optimization is indeed
mainly targeted to avoid such worst case.
Yes, tail trimming done on a block-basis is faster and does not consume
memory. The code for libxdiff would have to be a bit more complex though,
since memory files can be composed by many sections, of different sizes
(so you cannot just assume it's a single block you're trimming the end).
Also, you'd need some code at the end that hands you back at least the N
lines you want for context.
- Davide
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html