Skip to content

v1.9.0

Choose a tag to compare

@javimosch javimosch released this 08 Aug 19:32
· 17 commits to master since this release

What's new

Adaptive gzip compression for cp

Each 8 MiB chunk is gzip-compressed (BestSpeed level) before sending. If the compressed version is not at least 10% smaller, the raw bytes are sent instead — zero overhead for incompressible data.

Data type v1.8.0 v1.9.0 Speedup Wire savings
10MB zeros 16s 0.3s 53x 99.9%
10MB text (base64) 16.5s 13s 1.3x 24%
10MB source tar 11.4MB 6.7MB 41%
10MB random binary 21s 21s same 0% (skipped)

How it works

  1. Client compresses each chunk with gzip.BestSpeed
  2. If compressed_len < original_len * 0.9, sends compressed + sets Compressed: true in header
  3. Relay forwards the Compressed flag as-is (no re-serialization)
  4. Daemon decompresses with gzip.NewReader before writing to disk

Backwards compatibility

Old daemons that don't understand Compressed will ignore the flag and write compressed bytes to disk — but old clients never set it, so this only affects new-to-new transfers.

Issues

This further improves on #7 (cp transfer performance).

Generated with Devin