I have Ubuntu computers and an Android phone, and it's always perplexed me why the default update manager on Ubuntu and Google Play on the phone don't update existing versions of applications by calculating the difference between them and the new versions. I'm sure this is the case with other operating systems as well (which is why this question isn't in Ask Ubuntu or Android enthusiasts)

Consider, for example, the latest update (a minor release) of Google Maps (as of April 18,2012). The "What's new" section says it includes a critical bug fix. It's safe to assume a lot of code wasn't modified, and yet, when you update the app, it downloads over 6 MB, as if it's a fresh install.

Why can't the update servers calculate the difference (a la git) with installed versions and send only the difference? Can it really be that hard to do that with all versions? Wouldn't the saved bandwidth be a major motivation?

Edit 6 Dec 2016: Google just announced that they are going to use file-by-file patching for Android APK updates - Saving Data: Reducing the size of App Updates by 65%

  • Dunno. Fedora's done it for a few years already. – Ignacio Vazquez-Abrams Apr 18 '12 at 4:32
  • Chrome does it too when updating, I think. On mobile platforms the release cycles are likely slower, though, since you have the added overhead of letting the OS provider certify your app, etc. Lastly, a server offering updates would have to calculate the differences on the fly based on what version you have or cache them. bandwidth is cheap nowadays (and you don't update Google Maps on your Android phone via the cellular network, I guess) and adding more processing and storage requirements to the update servers probably isn't too high on anyone's list. – Joey Apr 18 '12 at 6:11
  • @IgnacioVazquez-Abrams: I didn't know that! Perhaps it's time I moved away from Ubuntu after all :) – WeNeigh Apr 22 '12 at 3:27

There are three levels at which you may optimize download size by transmitting only a diff.

Package level Only transmit updated packages. This is already done. If you look at the download sizes of packages you see that most of them are really small. Thus this safes the most bandwidth.

Files within a package Transmit only changed files within a package. Package management is more than just copying files to fixed locations. There are configuration files which may have been automatically adapted to your system. There may be manual changes. It would be hard to reliably figure out the difference without uploading the installed files first.

Inner file diffs Most and particularly the big files are binary. It's hard to imagine a reliable patch algorithm for binary files if the file to be patched has a small change like, e.g., a different build time stamp. For text files on the other hand the old diff and patch algorithms applied by git would probably work well but it's probably not worth the effort.

Another problem would be that you don't know which old version will be updated. Users may have skipped intermediate updates. Of course, the package manager could request the server to send a diff to a certain version, but that would put a huge load on the server to generate diffs. I doubt the server maintainers would allow that.

Summary: What could be done easily and reliably is already done. The rest is up to the package managers to make small packages to keep updates small.

  • 1
    Just as an aside, there are methods of updating binaries using a binary diff algorithm, such as bsdiff. In fact, Google Chrome uses its own binary diff algorithm called Courgette as part of its auto-update mechanism. – Stephen Jennings May 7 '12 at 4:00

Principally, it's technically hard for the developers. And bandwidth is cheap - or rather, the bill is footed by users.

Google Chrome invested a lot of smarts in developing incremental updates for Chrome binaries http://blog.chromium.org/2009/07/smaller-is-faster-and-safer-too.html .

Fedora developed 'delta rpms' to ship incremental package updates. Amusingly, because my computer has a fast network connection but a slow processor, these are actually install slower for me.

  • 1
    Haha, my situation is exactly the opposite. I'm in a "third world country", and my connection speed is appalling. I've often wished I could get diffs instead of entire packages, so I had to ask this question. – WeNeigh Nov 28 '12 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.