Skip to content

SC-9: compression support (--compress / -z using zlib) - #13

Merged
iampryce merged 1 commit into
mainfrom
sc-9-compression
Aug 2, 2026
Merged

SC-9: compression support (--compress / -z using zlib)#13
iampryce merged 1 commit into
mainfrom
sc-9-compression

Conversation

@iampryce

@iampryce iampryce commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Literal DataOp bytes compressed via zlib, batched per-file into one buffer per FrameDelta rather than per-op, to avoid zlib's ~8-byte overhead disproportionately hurting small literal runs - falls back to uncompressed if compression doesn't actually shrink the data. CopyOps and signatures are never compressed.

--compress-level: verified range 1-9, default 6, 0=off (overrides -z), -1=default, out-of-range clamped, and the '--compress-level alone implies --compress' rule - all matching token.c/rsync.1 exactly.

--skip-compress: real rsync's own 96-entry default suffix list, copied verbatim from rsync.1.md. Notable finding: upstream's current docs admit --skip-compress 'has no effect' in their own implementation (no algorithm supports mid-stream level changes) - grsync's per-file design makes a genuine skip decision instead, disclosed honestly as a real behavioral difference from upstream.

Compression turned out to be sender-only: Sender always runs locally for every CLI-wired path, so Receiver needed no new options and no SSH-argv or daemon wire-protocol changes.

Manual smoke test: a 129,562-byte compressible file dropped to 1,008 bytes received with -z. Verified compatible with dry-run, hard-links, and stats (correctly reporting bytes received, not sent, since Stats runs receiver-side).

Clean on native Windows and cross-compiled Linux.

Literal DataOp bytes compressed via zlib, batched per-file into one
buffer per FrameDelta rather than per-op, to avoid zlib's ~8-byte
overhead disproportionately hurting small literal runs - falls back to
uncompressed if compression doesn't actually shrink the data.
CopyOps and signatures are never compressed.

--compress-level: verified range 1-9, default 6, 0=off (overrides -z),
-1=default, out-of-range clamped, and the '--compress-level alone
implies --compress' rule - all matching token.c/rsync.1 exactly.

--skip-compress: real rsync's own 96-entry default suffix list, copied
verbatim from rsync.1.md. Notable finding: upstream's current docs
admit --skip-compress 'has no effect' in their own implementation (no
algorithm supports mid-stream level changes) - grsync's per-file design
makes a genuine skip decision instead, disclosed honestly as a real
behavioral difference from upstream.

Compression turned out to be sender-only: Sender always runs locally
for every CLI-wired path, so Receiver needed no new options and no
SSH-argv or daemon wire-protocol changes.

Manual smoke test: a 129,562-byte compressible file dropped to 1,008
bytes received with -z. Verified compatible with dry-run, hard-links,
and stats (correctly reporting bytes received, not sent, since Stats
runs receiver-side).

Clean on native Windows and cross-compiled Linux.
@iampryce
iampryce requested a review from jasonmiller-cc August 2, 2026 04:46
@iampryce
iampryce merged commit 21258c7 into main Aug 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant