Delta size comparison with rdiff and zchunk

124 views
Skip to first unread message

Adithya Balakumar

unread,
Sep 3, 2024, 5:09:49 AM9/3/24
to swupdate
Hi All,

I am trying to understand the variation in the delta size when rdiff and zchunk.
To explain what I have tried, I created a delta of 2 image (img1 -> img2) files with rdiff. The size of the delta file was 94 MB. 

Then I tried updating img1 to img2 with the delta handler (zchunk), where the total chunks downloaded amounted to about 96 MB.

So atleast in the given scenario that I am trying, there isn't too much difference between the delta size when using rdiff or zchunk.

However, I came across this information about rdiff that I quote below from the Delta update documentation in swupdate docs[1]
"It gives the best results in terms of reduced size when differences are very small, but the differential output tends to be very large as soon as the differences are meaningful. Differential images created for SWUpdate show that, as soon as the difference larger is, the resulting delta image can even become larger as the original one."

So, I would like to understand if there is any threshold or a sweet spot where the delta generated by rdiff can be larger when compared to the total size of chunks downloaded by zchunk. 

[1] https://sbabic.github.io/swupdate/delta-update.html#librsync

Thanks and Regards,
Adithya Balakumar

Stefano Babic

unread,
Sep 3, 2024, 6:29:57 AM9/3/24
to Adithya Balakumar, swupdate
Hi Aditha,

On 03.09.24 11:09, Adithya Balakumar wrote:
> Hi All,
>
> I am trying to understand the variation in the delta size when rdiff and
> zchunk.
> To explain what I have tried, I created a delta of 2 image (img1 ->
> img2) files with rdiff. The size of the delta file was 94 MB.
>
> Then I tried updating img1 to img2 with the delta handler (zchunk),
> where the total chunks downloaded amounted to about 96 MB.
>

This does not tell a lot. The use case of rsync and zchunk is very
different.

With rsync, you know exactly which version is on all of your devices in
field, and you supply a delta in rsync format for exactly this version.

With zchunk, the delta is computed by the device - you do not need to
know which version is running on the device, and Zchunk and suitable for
a delta update from any version to any version. In worst case, zchunk
will download the whole compresseed image. With rsync, the delta can be
bigger than the original image.

> So atleast in the given scenario that I am trying, there isn't too much
> difference between the delta size when using rdiff or zchunk.

Scenario is different.

>
> However, I came across this information about rdiff that I quote below
> from the Delta update documentation in swupdate docs[1]
> "/It gives the best results in terms of reduced size when differences
> are very small, but the differential output tends to be very large as
> soon as the differences are meaningful. Differential images created for
> SWUpdate show that, as soon as the difference larger is, the resulting
> delta image can even become larger as the original one./"
>

It seems very clear.

> So, I would like to understand if there is any threshold or a sweet spot
> where the delta generated by rdiff can be larger when compared to the
> total size of chunks downloaded by zchunk.

It depends on your image and your project. You cannot easy find a threshold.

>
> [1] https://sbabic.github.io/swupdate/delta-update.html#librsync
>

Best regards,
Stefano Babic

Adithya Balakumar

unread,
Sep 3, 2024, 6:45:05 AM9/3/24
to swupdate

Thanks for the quick response Stefano.

I understand the use cases of rdiff and zchunk. I was trying to update from v1 to v2 with both methods to try and understand if there would be any change in the delta size calculated by rdiff(delta image) and zchunk(chunks downloaded).

> In worst case, zchunk
> will download the whole compresseed image. With rsync, the delta can be
> bigger than the original image.

Yes, I understand the case of zchunk that you point out above. I am just trying how to reproduce a scenario where the rdiff delta size becomes larger than the original file.

Basically, I am trying to understand when to use zchunk over rdiff.


Reply all
Reply to author
Forward
0 new messages