I am currently developing an OTA/FOTA update system which must run in an embedded device with a ARM CORTEX M0+. My main problem is the FLASH lack of space and the network low network bandwidth I have, so the delta patches should be the smaller the better.
In order to get this result I did some research and found some binary diff algorithms and tools such as bsdiff, xdelta or courgette. My problem with all of them was the size, because I need to have a very small compiled application for running this, so I got a bsdiff standalone version (actually they were 2 versions: bsdiff standalone and minibsdiff):
https://github.com/Cheedoong/bsdiff
https://github.com/thoughtpolice/minibsdiff
The first one still uses bzip2 but is standalone and most suitable for an embedded system, but I wanted to test 2 things:
How is the size of the uncompressed delta. So I tried to remove all the bzip2 logic, getting that. I was very surprised when I noticed that the size of the delta was similar to the size of the complete original file, so I jumped to the second source, the minibsdiff.
The minibsdiff is the bsdiff but without any compression at all, letting you use whatever compression you want. It served me also to check that I was not wrong and that the generated uncompressed delta patch was the same size (or a bit more, because the header and others I suppose) than the original file I wanted to patch.
So... What is happening here? I read googling a bit that very similar files generate bigger patches but... during the tests I used 8 KB size files, getting 8KB uncompressed patches is not a solution, because then maybe it would be better only compress the file and substitute the old one by the new one.. I feel I am missing something.
Any idea will be very appreciated.
Thank you all.
Best regards,
Iván.