Ray's Knowledge Base
Unlock

A single-member gzip file collects about 8x slower than a multi-member one

PitfallVerified 4 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

A trace written by Python gzip (one member) collected in 4.7 s, with libdeflate dominating the profile. The same data recompressed as multi-member gzip collected 8x faster.

Cause#

A single member cannot be split across workers, so decode is serial.

Fix#

Recompress scratch trace files with dftracer_pgzip (multi-member) before any timing.

Evidence#

dftracer-utils, 2026-10-04, laghos trace. The same session measured a nested genesis (counters as arrays of objects inside func records) against the long format: the scan flattens arrays of objects by position (counters.<k>.<field>, 2,613 columns), collect took 572 against 213 ms and queries ran 5 to 10x slower; decoding positional path names was about half the cost. The user kept the long format.

Also found by searching

  • collect on a gzip trace is 8x slower than expected, libdeflate dominates the profile
  • python gzip written file slow to read in dftracer
  • how do I prepare a scratch trace file before timing a scan
  • single-member gzip decodes slowly