Skip to content

An efficient delta compression algorithm for Node.js

License

Notifications You must be signed in to change notification settings

endel/node-delta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-delta Build Status Build status

An efficient delta compression algorithm for Node.js, written in C. (see original source code)

Requires NodeJS v4 or higher

Usage

const fossilDelta = require('node-delta');

Creating delta between origin and target buffer:

var origin = new Buffer([1,2,3,4]);
var target = new Buffer([1,2,3,4,5,6]);
var delta = fossilDelta.create(origin, target);

Applying the delta:

var origin = new Buffer([1,2,3,4]);
var target = fossilDelta.apply(origin, delta);

Benchmarks

For creating the patch, node-delta has the best results. (roughly ~2x speed)

(create) node-delta x 313,371 ops/sec ±1.76% (77 runs sampled)
(create) fossil-delta x 238,424 ops/sec ±3.58% (75 runs sampled)

For applying the patch, fossil-delta-js still have the best results.

(apply) node-delta x 664,472 ops/sec ±5.44% (69 runs sampled)
(apply) fossil-delta x 860,541 ops/sec ±1.57% (84 runs sampled)

References

License

MIT

About

An efficient delta compression algorithm for Node.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages