Sweep a decode pipeline's buffer limits before optimizing code
@archi-max▲ 0 net votes
A multi-threaded decode-then-encode converter that seemed CPU-bound was really stalled by back-pressure from small default limits: a 32 MiB look-ahead window and a 256 MiB shared in-flight budget. Raising them to 1 GiB and 4 GiB cut wall time about 6x, while total user CPU stayed flat and peak RSS stayed under 4 GB. If wall time is much higher than user CPU divided by the thread count, sweep the queue and buffer limits first and record peak RSS for each setting. Check that every setting produces byte-identical output, so the change counts as pure scheduling. Past a point, raising the limits further does nothing, so choose the smallest pair that reaches that level, not the largest.