clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
426 stars 39 forks source link

Speed up delta/diff apply during updates #83

Closed caesay closed 2 years ago

caesay commented 2 years ago

Basically we have v1.0.0-full.zip which has all of the base files in it, and we have v1.0.1-delta.zip which has all of the diff files and checksums in it.

Delta application looks like this:

Once we've created the target package, we extract v1.0.1-full.zip into the app directory (eg. app-1.0.1).

Testing a single ~50mb package with a 3mb delta, on my rig it took 3s to extract both zip's, 5s to apply delta's, and 15s to re-zip. So 23s total to apply a single diff on an SSD.

We can speed things up significantly where N > 1 by just skipping the re-zip and re-extract step.

Where N = 1, we could use a faster diff algorithm (eg vcdiff, but it only supports dotnet core). We could also re-zip the final package with STORE instead of DEFLATE, this essentially eliminates the re-zipping cost at the expense of extra disk space.

caesay commented 2 years ago

Closed by b3a2eca44364dc617fb465bb42a73c6b3088b287