[pacman-dev] [PATCH] pkgdelta: use highest compression ratio when creating deltas with xdelta3

Allan McRae allan at archlinux.org
Wed Mar 5 18:33:05 EST 2014


On 06/03/14 09:25, Matthias Krüger wrote:
> Looking how pkgdelta works, I found this line
>     xdelta3  -q -f -s "$oldfile" "$newfile" "$deltafile" || ret=$?
> which seemed to be responsible for the actual delta generation, however
>     man xdelta3
> revealed that there were different compression levels (0-9) (not sure
> which one is default).
> To make it short, we could have had smaller deltas since pkgdelta was
> introduced!
> 
> Examples:
> 
> -9          16660K
> blender-12:2.69.c7ac0e-1_to_13:2.69.13290d-1-x86_64.delta
>  default  17832K blender-12:2.69.c7ac0e-1_to_13:2.69.13290d-1-x86_64.delta
> 
> -9         504K    xbmc-12.3-10_to_12.3-11-x86_64.delta
> default  572K   xbmc-12.3-10_to_12.3-11-x86_64.delta
> 

How is memory usage changed?   Mainly when regenerating the package from
deltas?

> The attached patch adds the "-9" option to the line above.
> 
> Side note: it might be even more advantageous to use bsdiff instead of
> xdelta3
> comparing the /usr/bin/blender binaries of the above versions
> (12:2.69.c7ac0e-1 and 13:2.69.13290d-1) :
> 
> xdelta3     10.4M
> xdelta3 -9   9.9M
> bsdiff          4.7M
> 
> ,however bsdiff is only for direct diff creation, bsdiff foo1.pkg.tar.xz
> foo2.pkg.tar.xz will create a diff between the archives and not their
> contents, so that'd require further coding which I am unable to do
> (maybe someone else volunteers :) ).

What do you mean "create a diff between the archives and not their
contents".   That does seem a significant decrease.

Allan



More information about the pacman-dev mailing list