bsdiff: Speed up pathological case.
bsdiff does not properly handle the case where there is a large block of
data in the new file that only differs from the old file by less than 8
bytes. This causes bsdiff to continue searching through the files one
byte at a time and at each byte, re-compare the same large block of data
which leads to excessively long run times. This fix checks for this
edge condition and breaks out of the search loop early. This retains
the size efficiency of the patch file for most binaries while preserving
the runtime efficiency for files that fall into this category.
TEST=unit tests, manually applied update, bsdiff known problematic files
Reviewed-by: Andrew de los Reyes <firstname.lastname@example.org>
Tested-by: Thieu Le <email@example.com>
1 file changed