|
|
Original BSD-Version written by Colin Percival <cperciva@freebsd.org>
This is a quick native Win32-Port by Andreas John <dynacore@tesla.inka.de>
Read this quick overview boldly copied from the homepage of these tools:
http://www.daemonology.net/bsdiff/
|
Binary diff/patch utility
|
bsdiff and bspatch are tools for building and applying patches to binary
files. By using suffix sorting (specifically, Larsson and Sadakane's
qsufsort) and taking advantage of how executable files change, bsdiff
routinely produces binary patches 50-80% smaller than those produced by
Xdelta, and 15% smaller than those produced by .RTPatch (a $2750/seat
commercial patch tool).
These programs were originally named bdiff and bpatch, but the large
number of other programs using those names lead to confusion; I'm not
sure if the "bs" in refers to "binary software" (because bsdiff produces
exceptionally small patches for executable files) or "bytewise
subtraction" (which is the key to how well it performs). Feel free to
offer other suggestions.
bsdiff and bspatch use bzip2; by default they assume it is in /usr/bin.
bsdiff is quite memory-hungry. It requires max(17*n,9*n+m)+O(1) bytes of
memory, where n is the size of the old file and m is the size of the new
file. bspatch requires n+m+O(1) bytes.
bsdiff runs in O((n+m) log n) time; on a 200MHz Pentium Pro, building a
binary patch for a 4MB file takes about 90 seconds. bspatch runs in
O(n+m) time; on the same machine, applying that patch takes about two
seconds.
Providing that off_t is defined properly, bsdiff and bspatch support
files of up to 2^61-1 = 2Ei-1 bytes.
|
|
Additional information about this win32-port:
bsdiff 4.3 doesn't require bzip2.exe anymore, it's now statically
linked with bzip2/bzlib.
Additionally off_t is currently defined to be 32 bit, so you're stuck with much
smaller files (2^31-1 bytes or 2 GB)...
But before you're going to ask for it to become 64 bit, do some quick math!
This version is compiled for 32-bit machines, and deliberately assuming we can only
address 2 GB of RAM per process, the biggest binary we can successfully
bsdiff is even smaller, just about 120 MB!
Keep in mind that bsdiff works very well for executable files where differences to their successors
tend to spread minor changes all over the file.
So, having huge files with mostly large parts identical, you should look for some other delta-tool,
see List of delta encoding software (Wikipedia)
|
|