automerge / automerge-classic

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
http://automerge.org/
MIT License
14.75k stars 467 forks source link

Add DEFLATE compression #330

Closed ept closed 3 years ago

ept commented 3 years ago

This PR adds support for DEFLATE compression. As explained in #317, compression can be used in two places:

Compression is only enabled when the data is larger than some threshold (currently 256 bytes) since it's not worth it on very short values.

@alexjg could I leave the implementation on the Rust side with you?

alexjg commented 3 years ago

Looks pretty straightforward, I'll pick it up for the Rust implementation later this week.

alexjg commented 3 years ago

The Rust implementation of this is ready to merge now.

ept commented 3 years ago

@alexjg Excellent, thank you! I have added some JS-wasm interop tests to check that deflate-compressed changes and documents work correctly in both directions. Merging this into performance now.