Mesh · compression upgrade study · 26 October 2026

Use Zstandard for negotiated sync responses.
Keep gzip for compatibility.

The fastest practical HTTP candidate is reusable Go Zstandard in its fastest mode, with literal entropy compression explicitly enabled. Pre-encryption record packing delivers the larger bandwidth gain. These are local synthetic measurements; production rollout remains a separate gate.

codec cases; all roundtrips match
faster large-page loopback completion
fewer wire bytes with existing record packing

Read the compression guide · Raw JSON · CSV

Four plots compare encoder time, compressed response size, loopback completion time and retained encoder memory.

What changes the decision

Explore all codec measurements

ProfileWire bytesOriginal leftEncode median / p95 (ms)Decode median / p95 (ms)Encode allocations (bytes/op)Samples encode / decode

Network completion model

Model, not a measured network: encoder median + payload bytes ÷ selected bandwidth + decoder median. Excludes HTTP headers, TLS, RTT, database work and streaming overlap. Both encode and decode use the selected implementation. Physical Moto, browser and low-power server timing are pending.

ProfileSequential completion model (ms)Payload transfer alone (ms)

Private loopback HTTP

24 measured requests per case after warmup; one Go worker, keepalive, no TLS, no database or signatures. Completion includes HTTP read, decompression and byte comparison. First response byte means response headers, not the first decoded record.

ProfileWire bytesMedian / p95 (ms)First response byte median (ms)Decoded throughput (MiB/s)Allocated bytes/request

Memory and reproducibility

EncoderRetained writersRetained heap (MiB)

Heap is measured after GC, with the large page already resident and compressed output discarded. It excludes decoder buffers and the rest of the application. Native peak RSS includes the Python interpreter and inherited process high-water; small workspace differences cannot be inferred from its common floor.

Method, versions and limitations

15 deterministic synthetic corpora, 228 bytes–4,058,818 bytes. Records use generated UTF-8 structured JSON, and simulated ciphertext uses uniform pseudorandom bytes. Real encrypted content is not inspected. The record packing pair starts from identical generated plaintext records; encryption is modeled by equal-length random bytes, so crypto CPU and nested-envelope overhead are excluded. Do not interpret the packing percentage as a forecast of user data.

A 16 KiB dictionary was trained on separate synthetic records with distinct IDs and a different seed; dictionary training and download cost are excluded from codec timing. Dictionary wins need amortization and a new negotiated record format.

Go Zstandard modes are library presets, approximately corresponding to native levels 1/3/7/11; levels are not directly comparable across libraries. Native bindings include allocation/copy overhead. Go reuse measurements keep output buffers warm; streaming HTTP and retained-memory measurements are separate. Empirical p95 with small sample counts is coarse, especially high-effort codecs. No phone energy, packet loss, target server, TLS or production tail latency has been measured. The benchmark run itself did not change or deploy production code; see the compression guide for current behavior.