Commit 1f402925 authored by Thieu Le's avatar Thieu Le Committed by Alex Deymo
Browse files

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.

BUG=chromium-os:16377
TEST=unit tests, manually applied update, bsdiff known problematic files

Change-Id: If84ad928603c71297f4d0977405893345f39d5c3
Reviewed-on: http://gerrit.chromium.org/gerrit/2640


Reviewed-by: default avatarAndrew de los Reyes <adlr@chromium.org>
Tested-by: default avatarThieu Le <thieule@chromium.org>
parent c2c68a78
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment