Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An efficient delta compression algorithm written in C#

License

NotificationsYou must be signed in to change notification settings

endel/FossilDelta

Repository files navigation

Build Status

This is a port from the original C implementation. See references below.

Fossil achieves efficient storage and low-bandwidth synchronization through theuse of delta-compression. Instead of storing or transmitting the completecontent of an artifact, fossil stores or transmits only the changes relative toa related artifact.

Other implementations:

Installation

NuGet Gallery

FossilDelta is available on theNuGet Gallery.

You can add FossilDelta to your project with theNuGet Package Manager, by using the following command in thePackage Manager Console.

PM> Install-Package FossilDelta

Usage

Fossil.Delta.Create(byte[] origin, byte[] target)

Returns the difference betweenorigin andtarget as a byte array (byte[])

Fossil.Delta.Apply(byte[] origin, byte[] delta)

Apply thedelta patch onorigin, returning the final value as byte array(byte[]).

Throws an error if it fails to apply the delta(e.g. if it was corrupted).

Fossil.Delta.OutputSize(byte[] delta)

Returns a size of target for this delta.

Throws an error if it can't read the size from delta.

Benchmark

See the inputs used for benchmarking. Run the benchmarkslocally using themake benchmark in your commandline.

Results:

       Method |           Mean |        StdErr |         StdDev |         Median |------------- |--------------- |-------------- |--------------- |--------------- | CreateDelta1 |  5,426.4132 ns |   787.5304 ns |  6,201.0206 ns |  4,286.4851 ns | CreateDelta2 | 21,837.1107 ns | 1,661.4695 ns | 13,900.8509 ns | 25,942.1491 ns | CreateDelta3 | 11,697.2018 ns | 1,213.1634 ns | 12,607.5636 ns |  9,260.4452 ns | CreateDelta4 |    253.4085 ns |    25.1048 ns |    214.4952 ns |    252.6454 ns | CreateDelta5 |    150.4963 ns |    29.0635 ns |    311.6718 ns |      0.0000 ns |  ApplyDelta1 |  3,547.0234 ns |   493.4131 ns |  4,357.7065 ns |  3,086.8397 ns |  ApplyDelta2 | 20,336.7691 ns | 2,488.0257 ns | 27,254.9560 ns |  9,233.5811 ns |  ApplyDelta3 |  1,441.5354 ns |   209.2071 ns |  1,995.7090 ns |    855.9650 ns |  ApplyDelta4 |    252.5743 ns |    29.7323 ns |    234.1123 ns |    236.0480 ns |  ApplyDelta5 |     68.5550 ns |     9.2923 ns |     92.4574 ns |     39.0918 ns |

[8]ページ先頭

©2009-2025 Movatter.jp