fix : no longer slow down on input saturation

only slows down when all buffers are full
This commit is contained in:
Yann Collet
2018-08-17 16:27:43 -07:00
parent 8b674d7dc7
commit 09e63c58ac
+6 -3
View File
@@ -808,9 +808,12 @@ FIO_compressZstdFrame(const cRess_t* ressPtr,
cpszfp = zfp;
if ( (zfp.ingested == cpszfp.ingested)
&& (zfp.consumed == cpszfp.consumed) ) {
DISPLAYLEVEL(2, "no data read nor consumed : buffers are full (?) output is too slow => slow down ; or compression is slow + input has reached its limit => can't tell \n")
if ( (zfp.ingested == cpszfp.ingested) /* no data read : input buffer full */
&& (zfp.consumed == cpszfp.consumed) /* no data compressed : no more buffer to compress OR compression is really slow */
&& (zfp.nbActiveWorkers == 0) /* confirmed : no compression : either no more buffer to compress OR not enough data to start first worker */
&& (zfp.currentJobID > 0) /* first job started : only remaining reason is no more available buffer to start compression */
) {
DISPLAYLEVEL(6, "all buffers full : compression stopped => slow down \n")
speedChange = slower;
}