Permalink
Commits on Sep 19, 2016
  1. Merge pull request #7 from trofi/master

    jjwhitney committed Sep 19, 2016
    libbdelta.cpp: tweak for c++11/gcc-6
Commits on Sep 18, 2016
  1. libbdelta.cpp: tweak for c++11/gcc-6

    trofi committed Sep 18, 2016
    On bcc-6.2.0 build fails as:
    
    ```
        g++ -shared -fPIC -O2  libbdelta.cpp -o libbdelta.so
        libbdelta.cpp: In function 'void bdelta_pass(BDelta_Instance*, unsigned int, unsigned int, unsigned int, unsigned int)':
        libbdelta.cpp:424:57: error: call of overloaded 'next(std::__cxx11::list<Match>::iterator&)' is ambiguous
              if (! (flags & BDELTA_SIDES_ORDERED) || (next(u1.ml) == u1.mr && next(u2.ml) == u2.mr))
                                                                 ^
        libbdelta.cpp:121:10: note: candidate: T next(T) [with T = std::_List_iterator<Match>]
         inline T next(T i) {return ++i;}
                  ^~~~
        In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6/bits/stl_algobase.h:66:0,
                         from /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6/list:60,
                         from libbdelta.cpp:18:
        /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6/bits/stl_iterator_base_funcs.h:205:5: note: candidate: _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type) [with _ForwardIterator = std::_List_iterator<Match>; typename std::iterator_traits<_Iter>::difference_type = long int]
             next(_ForwardIterator __x, typename
             ^~~~
        libbdelta.cpp:424:81: error: call of overloaded 'next(std::__cxx11::list<Match>::iterator&)' is ambiguous
              if (! (flags & BDELTA_SIDES_ORDERED) || (next(u1.ml) == u1.mr && next(u2.ml) == u2.mr))
                                                                                         ^
        libbdelta.cpp:121:10: note: candidate: T next(T) [with T = std::_List_iterator<Match>]
         inline T next(T i) {return ++i;}
                  ^~~~
        In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6/bits/stl_algobase.h:66:0,
                         from /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6/list:60,
                         from libbdelta.cpp:18:
        /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6/bits/stl_iterator_base_funcs.h:205:5: note: candidate: _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type) [with _ForwardIterator = std::_List_iterator<Match>; typename std::iterator_traits<_Iter>::difference_type = long int]
             next(_ForwardIterator __x, typename
             ^~~~
    ```
    
    Basically it tells that next() comes both from std::
    and from local scope (a c++11 addition):
        http://en.cppreference.com/w/cpp/iterator/next
    
    Renamed helper to bdelta_next().
    
    Reported-by: Toralf Förster
    Bug: https://bugs.gentoo.org/594246
    Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Commits on Jan 30, 2013
Commits on Jan 18, 2013
  1. Add .gitignore

    jjwhitney committed Jan 18, 2013
  2. Remove Changelog

    jjwhitney committed Jan 18, 2013
  3. Update Python sample code

    jjwhitney committed Jan 18, 2013
  4. Rewrite README file

    jjwhitney committed Jan 18, 2013
Commits on Dec 5, 2012
  1. Make sure sentry Match is deleted

    John Whitney committed Dec 5, 2012
    Matches can be placed before the front dummy sentry Match, so a search is necessary when it's time to delete it.
Commits on Dec 4, 2012
  1. Don't read beyond the end of buffers

    John Whitney committed Dec 4, 2012
    Fixes an off-by-one error in libbdelta where one token too many was being read from the end of a buffer, and could cause a crash when the buffer was user-supplied.
Commits on Nov 15, 2012
Commits on Nov 2, 2012
  1. Add BSD/Mac Makefile support

    jjwhitney committed Nov 2, 2012
  2. Merge pull request #3 from trofi/master

    jjwhitney committed Nov 2, 2012
    file.h: limit maximum amount of file I/O by 1MB
Commits on Nov 1, 2012
  1. file.h: cleanup constness of buffer pointer

    trofi committed Nov 1, 2012
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  2. libbdelta.cpp: amend types for format strings (gcc's -Wformat)

    trofi committed Nov 1, 2012
    Use %lu instead of %zu (mingw32-gcc and MSVC do not understand it
    as their libc is C99 incompatible).
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  3. file.h: limit maximum amount of file I/O by 1MB

    trofi committed Nov 1, 2012
    The problem was observed when I tried to run
    bdelta.exe --all-in-ram on 32-bit windows on
    network-mounted files.
    
    fread(size=170MB) failed with 'out of memory' there.
    
    I think it is a result of network-attached drives is
    implemented in userspace or calling process which leads
    to massive memory overhead when reading/writing large
    chunks of data.
    
    Fixed it by limiting I/O on 1MB size. It should I/O patterns
    slightly better for fuse-mounted linux filesystems as well.
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Commits on Oct 31, 2012
  1. Merge pull request #2 from trofi/master

    jjwhitney committed Oct 31, 2012
    Achieve 25% speedup in '--all-in-ram' mode
  2. bdelta: optimize --all-in-ram case by avoiding memcpy()

    trofi committed Oct 31, 2012
    libbdelta allows avoidance of temporary buffers if
    caller guarantees persistence of read data.
    
    --all-in-ram case is exactly this kind of workload!
    
    Adjust memory reading function to just return pointer to data.
    
    On my workload it speeds things up about ~25%
    
        time ./bdelta --all-in-ram win32.udb.{old,new,old-new.bdt}
        time bdelta --all-in-ram win32.udb.{old,new,old-new.bdt.orig}
    
        real    0m33.888s
        user    0m28.790s
        sys     0m2.316s
    
        real    0m39.990s
        user    0m35.116s
        sys     0m2.189s
    
    win32.udb.old and  win32.udb.new are files 171MB sized,
    patch is 27MB with 1 million of chunks.
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  3. match_backward(): don't overrun buffer when user supplies block size …

    trofi committed Oct 31, 2012
    …more, than 4096 bytes
    
    User can (And I did) pass large block sizes for initial passes,
    but the code is not ready for it:
    
        match_backward() {
            ...
            if (numtoread > blocksize) numtoread = blocksize;
            Token buf1[4096], buf2[4096];
            const Token *read1 = b->read1(buf1, p1, numtoread),
            ...
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  4. Makefile: support for static library (handy to make better optimized …

    trofi committed Sep 27, 2012
    …static binary)
    
    Usage example:
        make libbdelta.a bdelta LDFLAGS=-static
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  5. constify return value of 'read' callback.

    trofi committed Oct 31, 2012
    Make sure we don't modify data supplied by user.
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Commits on Sep 28, 2012
  1. Merge pull request #1 from trofi/master

    jjwhitney committed Sep 28, 2012
    bdelta: add '--all-in-ram' commandline option
Commits on Sep 26, 2012
  1. bdelta: add '--all-in-ram' commandline option

    trofi committed Sep 26, 2012
    $ time ./bdelta /tmp/foo.{old,new} foo-old-to-new.bdt;  time ./bdelta --all-in-ram /tmp/foo.{old,new} foo-old-to-new.bdt
    
    real    3m19.176s
    user    2m1.324s
    sys     1m17.076s
    
    real    1m46.074s
    user    1m41.454s
    sys     0m3.669s
    
    File sizes are ~80 megabytes each.
    The option greatly reduces I/O overhead (sys time) and speeds up delta creation.
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Commits on Feb 17, 2012
  1. Merge branch 'experimental'

    jjwhitney committed Feb 17, 2012
    Conflicts:
    	src/bdelta.cpp
    	src/bdelta_python.cpp
    	src/libbdelta.cpp
Commits on Feb 16, 2012
Commits on Feb 15, 2012
  1. Fix MSVC++ compile errors.

    jjwhitney committed Feb 15, 2012
Commits on Feb 7, 2012
  1. Use BDELTA_GLOBAL as a flag, instead of BDELTA_LOCAL. Also, fix BDelt…

    jjwhitney committed Jan 13, 2012
    …a's Python wrapper for flag handling.
  2. Add ability to require that the hole sides be ordered or the hole sid…

    jjwhitney committed Jan 13, 2012
    …e be under a specified maximum.
  3. Use Cython to create a new Python wrapper which is much more function…

    jjwhitney committed Jan 11, 2012
    …al than the old one.