The problem of optimizing the parameters of a laser pulse compressor consisting of four identical diffraction gratings is solved analytically. The goal of optimization is to obtain maximum pulse power, completely excluding both beam clipping on gratings and the appearance of spurious diffraction orders. The analysis is carried out in a general form for an out-of-plane compressor. Two particular "plane" cases attractive from a practical point of view are analyzed in more detail: a standard Treacy compressor (TC) and a compressor with an angle of incidence equal to the Littrow angle (LC). It is shown that in both cases the LC is superior to the TC. Specifically, for 160-cm diffraction gratings, optimal LC design enables 107 PW for XCELS and 111 PW for SEL-100 PW, while optimal TC design enables 86 PW for both projects.