See reps-strings.c, in particular rep_read_range() and window_handler().
The current undeltification algorithm is wasteful because it may spend
time and space reconstructing data that will not end up being used. A
real delta combiner would "compose" delta windows instruction by instruction
and not bother with irrelevant parts; also, certain spurious re-copying of
data would be avoided.
This change is probably necessary to handle large files well; we're writing
some fs tests to measure this more precisely.