简体   繁体   中英

What would be a good algorithm for patching binary files on Linux?

I am trying to reduce data transfer to my embedded Linux device by creating patches for almost similar binaries.

I have memory constraints on my device and hence heavy algorithms like bsdiff and bspatch are unaffordable on my target for binary sizes of around 36-60 MB. I would like to know the commands that have the best algorithms for diffing and patching files that can work with minimalistic amount of memory. I am attaching output of df and free as well here.

目标的内存细节

For comparison between xdelta and bsdiff , the bsdiff (mbsdiff) seems to be more efficient in terms of delta size and memory consumption.

It turns out that rdiff uses a slightly better algorithm in terms of memory, but it creates a bigger patch (delta) file than either of bsdiff or xdelta3.

xdelta3 creates the smallest patchfile, but it uses more memory to create the patch than rdiff does. So in terms of the created patch size, we have— xdelta3 < bsdiff < rdiff .

And in terms of memory consumption while applying patch we have—rdiff < xdelta3 < bsdiff

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM