Commit Graph

22 Commits

Author SHA1 Message Date
Patrick McCarty e27563e653 Rename oldsize->old_size and newsize->new_size
To align better with variable renamings in the forthcoming commit,
rename the two variables indicating size of the old and new files first.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-10-09 21:30:45 -07:00
Patrick McCarty e0e8bcda58 Release v1.0.4
This release fixes an issue with libbsdiff thread safety. This was a
regression introduced in v1.0.3.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
v1.0.4
2018-06-14 14:50:54 -07:00
Patrick McCarty 2e5b80929c Make revised search algorithm thread safe
In commit 85b1c5345b, I introduced a new "max_len" variable, used by the
search() function to store the maximum match length found in course of
the binary search.

However, I overlooked the fact that the search() function then lost
thread safety, as "max_len" would be shared by all threads of a process
using libbsdiff.

Fix the issue by not using a global variable, instead updating "max_len"
via another pointer, just like the "pos" variable is handled already.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-06-14 14:46:52 -07:00
Patrick McCarty 6127bd6095 Release v1.0.3
This release fixes a bug that results in significantly improved diff
creation times in certain cases.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
v1.0.3
2018-02-22 18:04:24 -08:00
Patrick McCarty 85b1c5345b Find the longest match in the suffix-sorted array
Fixes #2

The current implementation performs a binary search through the
suffix-sorted array to find byte sequence matches between old and new
files. However, the algorithm is not optimal when it repeatedly matches
very short strings, leading to performance issues as reported in issue
 #2.

This commit changes the algorithm to consider *all* matches encountered
during the binary search and choose the longest of these matches.

The overall performance impact is yet to be determined, but it appears
to yield a small percentage increase in diff creation time (expected)
and a large percentage *decrease* for the case of diffing the files from
issue #2. In my testing, the creation time there decreases from approx
64 minutes to 4.5 seconds.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-02-22 18:01:17 -08:00
Patrick McCarty d039492824 Fix code style
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-06-12 11:33:09 -07:00
Patrick McCarty 43a817a2e5 build: add 'compliant' makefile target for fixing code style
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-06-12 11:32:33 -07:00
Patrick McCarty 4e868b4772 Split suffix sort code into a separate source file
To prepare for the possibility of testing other suffix sort algorithms
in the future, split this code into a separate source file for clarity.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-06-12 11:24:09 -07:00
Patrick McCarty 71b9d7e78a Allow for skipping valgrind use in tests
In case the system valgrind is not functioning properly, allow the test
suite to run without using the tool by setting SKIP_VALGRIND=1 for `make
check`.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-12-13 10:07:22 -08:00
Patrick McCarty b46a4e2c0f Run clang-format to fix code style
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-12-13 09:49:33 -08:00
Patrick McCarty 5342235446 Release version 1.0.2
This release enables the functional test suite by default. To disable
the ability to run the test suite and its dependency checks, pass
--disable-tests to configure for the build.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
v1.0.2
2016-11-21 13:25:41 -08:00
Patrick McCarty 8ed6fb38aa Fix distcheck
The remaining test files need to be distributed in order to run the test
suite, and export abs_builddir to the test script to point to the
binaries.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-11-21 13:25:41 -08:00
Patrick McCarty f23f25a43c Enable travis-ci integration
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-11-21 10:50:39 -08:00
Patrick McCarty 8654e611cf Use 'readlink -f' instead of 'realpath'
Some distros do not ship the coreutils 'realpath', so use 'readlink -f'
instead, which is equivalent for the usage here.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-11-21 10:48:23 -08:00
Patrick McCarty fb5ced7c2c configure: fix libcheck minimum version
TAP support was added in libcheck version 0.9.12.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-10-28 17:50:36 -07:00
Patrick McCarty 150cc28bbe configure: disable libcheck test if test build is disabled
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-10-28 17:48:22 -07:00
Patrick McCarty 8c0a87b7c9 Convert functional test suite to TAP
Automake provides a nice test harness that can parse TAP results, so
switch to using that.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-02-26 15:46:30 -08:00
Patrick McCarty 253dcbbbc0 Provide configure option to disable tests
Building the tests is enabled by default, but because the test suite
requires root privileges to run at the moment, people should have to
option to disable the tests entirely.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-02-26 15:44:21 -08:00
Patrick McCarty a11afb9d3b Cleanups for building with test coverage
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-02-26 15:42:59 -08:00
Patrick McCarty 33273c0f93 Release version 1.0.1
This release fixes a small issue with permissions on the target files
created by both bsdiff and bspatch, namely that there is no reason for
them not to be group and world readable.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
v1.0.1
2016-02-26 12:59:53 -08:00
Patrick McCarty 7525374a10 Open target files write-only and loosen their permissions
Because the target files are only written to, not read from, by either
bsdiff or bspatch, we can open them write-only.

Also, I don't see a reason for the file permissions to be 600, so loosen
the permissions to be 644.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-02-26 11:21:38 -08:00
Patrick McCarty 285133f334 Initial commit
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
v1.0.0
2016-02-16 11:57:55 -08:00