Ray's Knowledge Base
Unlock

A multi-file run ends when its biggest file ends, so speedups to the other files barely move the total

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

Symptom#

A change that should have sped up the whole run (fold chains) cut the 12-part wall time only from about 260 s to 242 s. The measured gain was far smaller than expected.

Cause#

Most files finish in about two minutes. After that only the biggest file runs, and CPU use falls from about 76 cores to 2. That one file (shard-6, 22% of all counter records) sets the end time, and the change did not make it faster.

Fix#

Before tuning, time the biggest file alone and look at CPU over time. Tune the step that limits that file. Check the gain on that file alone, and then on the full run. Splitting one big file across several builds is the only way past a per-file limit.

Evidence#

"Because the total time is set by one file, and fold chains did not make that file faster." "Shard-6 alone holds 160 million of the 710 million counter records (22%)." "alone, it took 185 s before fold chains and 196 s after."